lots of macbook vim stuff
This commit is contained in:
parent
5b483a9db7
commit
feb59d91c5
|
@ -0,0 +1,15 @@
|
||||||
|
globals = {
|
||||||
|
'vim',
|
||||||
|
'assert',
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Don't report unused self arguments of methods.
|
||||||
|
self = false
|
||||||
|
|
||||||
|
-- Rerun tests only if their modification time changed.
|
||||||
|
cache = true
|
||||||
|
|
||||||
|
ignore = {
|
||||||
|
'631', -- max_line_length
|
||||||
|
'212/_.*', -- unused argument, for vars with "_" prefix
|
||||||
|
}
|
72
init.lua
72
init.lua
|
@ -20,73 +20,8 @@
|
||||||
=====================================================================
|
=====================================================================
|
||||||
=====================================================================
|
=====================================================================
|
||||||
|
|
||||||
What is Kickstart?
|
|
||||||
|
|
||||||
Kickstart.nvim is *not* a distribution.
|
|
||||||
|
|
||||||
Kickstart.nvim is a starting point for your own configuration.
|
|
||||||
The goal is that you can read every line of code, top-to-bottom, understand
|
|
||||||
what your configuration is doing, and modify it to suit your needs.
|
|
||||||
|
|
||||||
Once you've done that, you can start exploring, configuring and tinkering to
|
|
||||||
make Neovim your own! That might mean leaving Kickstart just the way it is for a while
|
|
||||||
or immediately breaking it into modular pieces. It's up to you!
|
|
||||||
|
|
||||||
If you don't know anything about Lua, I recommend taking some time to read through
|
|
||||||
a guide. One possible example which will only take 10-15 minutes:
|
|
||||||
- https://learnxinyminutes.com/docs/lua/
|
|
||||||
|
|
||||||
After understanding a bit more about Lua, you can use `:help lua-guide` as a
|
|
||||||
reference for how Neovim integrates Lua.
|
|
||||||
- :help lua-guide
|
|
||||||
- (or HTML version): https://neovim.io/doc/user/lua-guide.html
|
|
||||||
|
|
||||||
Kickstart Guide:
|
|
||||||
|
|
||||||
TODO: The very first thing you should do is to run the command `:Tutor` in Neovim.
|
|
||||||
|
|
||||||
If you don't know what this means, type the following:
|
|
||||||
- <escape key>
|
|
||||||
- :
|
|
||||||
- Tutor
|
|
||||||
- <enter key>
|
|
||||||
|
|
||||||
(If you already know the Neovim basics, you can skip this step.)
|
|
||||||
|
|
||||||
Once you've completed that, you can continue working through **AND READING** the rest
|
|
||||||
of the kickstart init.lua.
|
|
||||||
|
|
||||||
Next, run AND READ `:help`.
|
|
||||||
This will open up a help window with some basic information
|
|
||||||
about reading, navigating and searching the builtin help documentation.
|
|
||||||
|
|
||||||
This should be the first place you go to look when you're stuck or confused
|
|
||||||
with something. It's one of my favorite Neovim features.
|
|
||||||
|
|
||||||
MOST IMPORTANTLY, we provide a keymap "<space>sh" to [s]earch the [h]elp documentation,
|
|
||||||
which is very useful when you're not exactly sure of what you're looking for.
|
|
||||||
|
|
||||||
I have left several `:help X` comments throughout the init.lua
|
|
||||||
These are hints about where to find more information about the relevant settings,
|
|
||||||
plugins or Neovim features used in Kickstart.
|
|
||||||
|
|
||||||
NOTE: Look for lines like this
|
|
||||||
|
|
||||||
Throughout the file. These are for you, the reader, to help you understand what is happening.
|
|
||||||
Feel free to delete them once you know what you're doing, but they should serve as a guide
|
|
||||||
for when you are first encountering a few different constructs in your Neovim config.
|
|
||||||
|
|
||||||
If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
|
|
||||||
|
|
||||||
I hope you enjoy your Neovim journey,
|
|
||||||
- TJ
|
|
||||||
|
|
||||||
P.S. You can delete this when you're done too. It's your config now! :)
|
|
||||||
-- ]]
|
-- ]]
|
||||||
|
|
||||||
-- Set <space> as the leader key
|
|
||||||
-- See `:help mapleader`
|
|
||||||
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
|
|
||||||
vim.g.mapleader = ' '
|
vim.g.mapleader = ' '
|
||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
|
@ -110,7 +45,6 @@ vim.api.nvim_create_autocmd({ 'FileType' }, {
|
||||||
vim.opt_local.shiftwidth = 2
|
vim.opt_local.shiftwidth = 2
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
-- See `:help vim.opt`
|
-- See `:help vim.opt`
|
||||||
-- NOTE: You can change these options as you wish!
|
-- NOTE: You can change these options as you wish!
|
||||||
|
@ -147,7 +81,7 @@ vim.opt.smartcase = true
|
||||||
vim.opt.signcolumn = 'yes'
|
vim.opt.signcolumn = 'yes'
|
||||||
|
|
||||||
-- Decrease update time
|
-- Decrease update time
|
||||||
vim.opt.updatetime = 250
|
vim.opt.updatetime = 125
|
||||||
|
|
||||||
-- Decrease mapped sequence wait time
|
-- Decrease mapped sequence wait time
|
||||||
-- Displays which-key popup sooner
|
-- Displays which-key popup sooner
|
||||||
|
@ -184,7 +118,6 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
|
||||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
|
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
|
||||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
||||||
|
|
||||||
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
||||||
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
|
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
|
||||||
-- is not what someone will guess without a bit more experience.
|
-- is not what someone will guess without a bit more experience.
|
||||||
|
@ -258,7 +191,8 @@ local opts = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require 'autocommand'
|
||||||
|
require 'fancyutil'
|
||||||
require('lazy').setup('plugins', opts)
|
require('lazy').setup('plugins', opts)
|
||||||
|
|
||||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
vim.cmd [[:command! -nargs=1 I lua inspectFn(<f-args>)]]
|
||||||
|
function inspectFn(obj)
|
||||||
|
local cmd = string.format('lua print(vim.inspect(%s))', obj)
|
||||||
|
require('noice').redirect(cmd, { view = 'messages', filter = {} })
|
||||||
|
end
|
|
@ -0,0 +1,19 @@
|
||||||
|
-- init module
|
||||||
|
local _M = {}
|
||||||
|
|
||||||
|
--- @param bufnr integer | nil
|
||||||
|
--- @return true | false | nil
|
||||||
|
function _M.get_oil_nnn(bufnr)
|
||||||
|
bufnr = bufnr or 0
|
||||||
|
local ok, value = pcall(vim.api.nvim_buf_get_var, bufnr, 'nnn')
|
||||||
|
if not ok then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
if value then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
vim.fn.get_oil_nnn = _M.get_oil_nnn
|
||||||
|
|
||||||
|
return _M
|
|
@ -1,7 +1,7 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'tzachar/highlight-undo.nvim',
|
'tzachar/highlight-undo.nvim',
|
||||||
config = function(opts)
|
config = function()
|
||||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
desc = 'Highlight when yanking (copying) text',
|
desc = 'Highlight when yanking (copying) text',
|
||||||
group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }),
|
group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }),
|
||||||
|
|
|
@ -6,7 +6,6 @@ return {
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
init = function()
|
init = function()
|
||||||
vim.cmd.colorscheme 'catppuccin-mocha'
|
vim.cmd.colorscheme 'catppuccin-mocha'
|
||||||
-- You can configure highlights by doing something like:
|
|
||||||
vim.cmd.hi 'Comment gui=none'
|
vim.cmd.hi 'Comment gui=none'
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'folke/lazydev.nvim',
|
||||||
|
ft = 'lua',
|
||||||
|
opts = {
|
||||||
|
library = {
|
||||||
|
vim.env.HOME .. '.local/share/nvim/lazy/luvit-meta/library/',
|
||||||
|
-- You can also add plugins you always want to have loaded.
|
||||||
|
-- Useful if the plugin has globals or types you want to use
|
||||||
|
-- vim.env.LAZY .. "/LazyVim", -- see below
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ 'Bilal2453/luvit-meta', lazy = true },
|
||||||
|
{
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.sources = opts.sources or {}
|
||||||
|
table.insert(opts.sources, {
|
||||||
|
name = 'lazydev',
|
||||||
|
group_index = 0, -- set group index to 0 to skip loading LuaLS completions
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
|
@ -15,6 +15,7 @@ return {
|
||||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
||||||
group = lint_augroup,
|
group = lint_augroup,
|
||||||
callback = function()
|
callback = function()
|
||||||
|
require('lint').try_lint 'codespell'
|
||||||
require('lint').try_lint()
|
require('lint').try_lint()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -5,12 +5,21 @@ return {
|
||||||
'williamboman/mason.nvim',
|
'williamboman/mason.nvim',
|
||||||
'williamboman/mason-lspconfig.nvim',
|
'williamboman/mason-lspconfig.nvim',
|
||||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||||
'folke/neodev.nvim',
|
'folke/lazydev.nvim',
|
||||||
{ 'j-hui/fidget.nvim' },
|
{ 'j-hui/fidget.nvim' },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require 'plugins.neodev'
|
require('lazydev').setup {}
|
||||||
require('neoconf').setup {}
|
require('neoconf').setup {}
|
||||||
|
vim.diagnostic.config {
|
||||||
|
update_in_insert = true,
|
||||||
|
float = {
|
||||||
|
focusable = false,
|
||||||
|
},
|
||||||
|
signs = true,
|
||||||
|
underline = true,
|
||||||
|
virtual_text = false,
|
||||||
|
}
|
||||||
|
|
||||||
-- function will be executed to configure the current buffer
|
-- function will be executed to configure the current buffer
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
@ -46,22 +55,13 @@ return {
|
||||||
tsserver = {},
|
tsserver = {},
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
settings = {
|
settings = {
|
||||||
lua = {
|
Lua = {
|
||||||
runtime = {
|
runtime = {
|
||||||
version = 'LuaJIT',
|
version = 'LuaJIT',
|
||||||
},
|
},
|
||||||
workspace = {
|
workspace = {
|
||||||
checkthirdparty = { lazyPlugins },
|
checkthirdparty = { lazyPlugins },
|
||||||
|
library = vim.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), { vim.env.VIMRUNTIME }),
|
||||||
library = {
|
|
||||||
vim.env.VIMRUNTIME,
|
|
||||||
-- -- depending on the usage, you might want to add additional paths here.
|
|
||||||
-- -- "${3rd}/luv/library"
|
|
||||||
-- -- "${3rd}/busted/library",
|
|
||||||
-- },
|
|
||||||
-- or pull in all of 'runtimepath'. note: this is a lot slower
|
|
||||||
},
|
|
||||||
-- library = vim.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), { vim.env.VIMRUNTIME }),
|
|
||||||
},
|
},
|
||||||
completion = {
|
completion = {
|
||||||
callSnippet = 'Replace',
|
callSnippet = 'Replace',
|
||||||
|
@ -76,6 +76,7 @@ return {
|
||||||
},
|
},
|
||||||
jsonls = {},
|
jsonls = {},
|
||||||
yamlls = {},
|
yamlls = {},
|
||||||
|
eslint_d = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- You can press `g?` for help in this menu.
|
-- You can press `g?` for help in this menu.
|
||||||
|
@ -89,17 +90,11 @@ return {
|
||||||
handlers = {
|
handlers = {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
local server = servers[server_name] or {}
|
local server = servers[server_name] or {}
|
||||||
-- This handles overriding only values explicitly passed
|
|
||||||
-- by the server configuration above. Useful when disabling
|
|
||||||
-- certain features of an LSP (for example, turning off formatting for tsserver)
|
|
||||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||||
require('lspconfig')[server_name].setup(server)
|
require('lspconfig')[server_name].setup(server)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
settings = {
|
|
||||||
Lua = {},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,13 @@ return {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ 'nvim-tree/nvim-web-devicons' },
|
{ 'nvim-tree/nvim-web-devicons' },
|
||||||
{ 'folke/noice.nvim' },
|
{ 'folke/noice.nvim' },
|
||||||
|
{ 'arkav/lualine-lsp-progress' },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local noice = require 'noice'
|
local colors = {
|
||||||
|
gray = '#6c7086',
|
||||||
|
purple = '#cba6f7',
|
||||||
|
}
|
||||||
|
|
||||||
require('lualine').setup {
|
require('lualine').setup {
|
||||||
options = {
|
options = {
|
||||||
|
@ -19,17 +23,17 @@ return {
|
||||||
{
|
{
|
||||||
'mode',
|
'mode',
|
||||||
separator = { left = '' },
|
separator = { left = '' },
|
||||||
fmt = function(_, context)
|
fmt = function(_, _)
|
||||||
local winnr = vim.fn.tabpagewinnr(context.tabnr)
|
-- local winnr = vim.fn.tab (context.tabnr)
|
||||||
local ok, val = pcall(vim.api.nvim_win_get_var, winnr, 'nnn')
|
-- vim.fn.winbufnr(winnr)
|
||||||
if ok and val then
|
local val = require('fancyutil').get_oil_nnn()
|
||||||
|
if val then
|
||||||
return 'nnn'
|
return 'nnn'
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
color = function(section)
|
color = function(_)
|
||||||
local winnr = vim.api.nvim_get_current_win()
|
local val = require('fancyutil').get_oil_nnn()
|
||||||
local ok, val = pcall(vim.api.nvim_win_get_var, winnr, 'nnn')
|
if val == true then
|
||||||
if ok and val then
|
|
||||||
return { fg = '#054fca' }
|
return { fg = '#054fca' }
|
||||||
end
|
end
|
||||||
return {}
|
return {}
|
||||||
|
@ -38,18 +42,16 @@ return {
|
||||||
},
|
},
|
||||||
lualine_x = {
|
lualine_x = {
|
||||||
{
|
{
|
||||||
noice.api.status.message.get_hl,
|
'lsp_progress',
|
||||||
cond = noice.api.status.message.has,
|
display_components = { 'lsp_client_name', { 'title', 'percentage', 'message' } },
|
||||||
|
colors = {
|
||||||
|
percentage = colors.gray,
|
||||||
|
title = colors.gray,
|
||||||
|
message = colors.gray,
|
||||||
|
spinner = colors.gray,
|
||||||
|
lsp_client_name = colors.purple,
|
||||||
|
use = true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
noice.api.status.command.get_hl,
|
|
||||||
cond = noice.api.status.command.has,
|
|
||||||
color = { fg = '#ff0000' },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
noice.api.status.mode.get,
|
|
||||||
cond = noice.api.status.mode.has,
|
|
||||||
color = { fg = '#00ff00' },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lualine_z = {
|
lualine_z = {
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
'folke/neodev.nvim',
|
|
||||||
opts = {
|
|
||||||
library = {
|
|
||||||
enabled = true,
|
|
||||||
runtime = true,
|
|
||||||
types = true,
|
|
||||||
plugins = true,
|
|
||||||
-- plugins = { "nvim-treesitter", "plenary.nvim", "telescope.nvim" },
|
|
||||||
},
|
|
||||||
setup_jsonls = true,
|
|
||||||
lspconfig = true,
|
|
||||||
pathStrict = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -24,6 +24,7 @@ return {
|
||||||
'saadparwaiz1/cmp_luasnip',
|
'saadparwaiz1/cmp_luasnip',
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
'hrsh7th/cmp-path',
|
'hrsh7th/cmp-path',
|
||||||
|
'hrsh7th/cmp-nvim-lsp-signature-help',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- See `:help cmp`
|
-- See `:help cmp`
|
||||||
|
@ -88,6 +89,7 @@ return {
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'nvim_lsp_signature_help' },
|
{ name = 'nvim_lsp_signature_help' },
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'lazydev' },
|
||||||
{ name = 'luasnip' },
|
{ name = 'luasnip' },
|
||||||
{ name = 'path' },
|
{ name = 'path' },
|
||||||
{ name = 'nvim_lua' },
|
{ name = 'nvim_lua' },
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
return {
|
return {
|
||||||
{
|
|
||||||
'stevearc/oil.nvim',
|
'stevearc/oil.nvim',
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
event = 'VimEnter',
|
event = 'VimEnter',
|
||||||
|
@ -12,6 +11,19 @@ return {
|
||||||
mode = '',
|
mode = '',
|
||||||
desc = 'Close current window',
|
desc = 'Close current window',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'<leader>tn',
|
||||||
|
function()
|
||||||
|
local val = require('fancyutil').get_oil_nnn()
|
||||||
|
if val == true then
|
||||||
|
vim.api.nvim_buf_set_var(bufnr, 'nnn', false)
|
||||||
|
elseif val == false then
|
||||||
|
vim.api.nvim_buf_set_var(bufnr, 'nnn', true)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
mode = '',
|
||||||
|
desc = '[T]oggle [n]nn Mode',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'~',
|
'~',
|
||||||
'<CMD>Oil<CR>',
|
'<CMD>Oil<CR>',
|
||||||
|
@ -21,7 +33,7 @@ return {
|
||||||
{
|
{
|
||||||
'<Left>',
|
'<Left>',
|
||||||
function()
|
function()
|
||||||
if require('oil.util').is_oil_bufnr(0) then
|
if require('oil.util').is_oil_bufnr(0) and require('fancyutil').get_oil_nnn() then
|
||||||
local oil = require 'oil'
|
local oil = require 'oil'
|
||||||
local bufname = vim.api.nvim_buf_get_name(0)
|
local bufname = vim.api.nvim_buf_get_name(0)
|
||||||
local parent = oil.get_buffer_parent_url(bufname, true)
|
local parent = oil.get_buffer_parent_url(bufname, true)
|
||||||
|
@ -31,7 +43,7 @@ return {
|
||||||
local keys = vim.api.nvim_replace_termcodes('<Left>', true, false, true)
|
local keys = vim.api.nvim_replace_termcodes('<Left>', true, false, true)
|
||||||
vim.api.nvim_feedkeys(keys, 'n', false)
|
vim.api.nvim_feedkeys(keys, 'n', false)
|
||||||
end,
|
end,
|
||||||
mode = 'i',
|
mode = '',
|
||||||
desc = 'Move up the file tree',
|
desc = 'Move up the file tree',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -40,7 +52,7 @@ return {
|
||||||
local oil = require 'oil'
|
local oil = require 'oil'
|
||||||
local entry = oil.get_cursor_entry()
|
local entry = oil.get_cursor_entry()
|
||||||
local dir = oil.get_current_dir()
|
local dir = oil.get_current_dir()
|
||||||
if entry and dir then
|
if entry and dir and require('fancyutil').get_oil_nnn() then
|
||||||
local path = dir .. entry.name
|
local path = dir .. entry.name
|
||||||
local stat = vim.loop.fs_stat(path)
|
local stat = vim.loop.fs_stat(path)
|
||||||
if stat and stat.type == 'directory' then
|
if stat and stat.type == 'directory' then
|
||||||
|
@ -51,16 +63,17 @@ return {
|
||||||
local keys = vim.api.nvim_replace_termcodes('<Right>', true, false, true)
|
local keys = vim.api.nvim_replace_termcodes('<Right>', true, false, true)
|
||||||
vim.api.nvim_feedkeys(keys, 'n', false)
|
vim.api.nvim_feedkeys(keys, 'n', false)
|
||||||
end,
|
end,
|
||||||
mode = 'i',
|
mode = '',
|
||||||
desc = 'Move down the file tree',
|
desc = 'Move down the file tree',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
default_file_explorer = true,
|
default_file_explorer = true,
|
||||||
|
restore_window_options = true,
|
||||||
|
|
||||||
win_options = {
|
win_options = {
|
||||||
wrap = true,
|
wrap = true,
|
||||||
signcolumn = 'no',
|
signcolumn = 'yes',
|
||||||
cursorcolumn = false,
|
cursorcolumn = false,
|
||||||
foldcolumn = '0',
|
foldcolumn = '0',
|
||||||
spell = false,
|
spell = false,
|
||||||
|
@ -68,7 +81,6 @@ return {
|
||||||
conceallevel = 3,
|
conceallevel = 3,
|
||||||
concealcursor = 'nivc',
|
concealcursor = 'nivc',
|
||||||
},
|
},
|
||||||
restore_window_options = true,
|
|
||||||
|
|
||||||
view_options = {
|
view_options = {
|
||||||
show_hidden = true,
|
show_hidden = true,
|
||||||
|
@ -76,10 +88,31 @@ return {
|
||||||
return name:match '.git'
|
return name:match '.git'
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
-- group = aug,
|
||||||
extensions = {
|
extensions = {
|
||||||
'oil',
|
'oil',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
config = function(_, opts)
|
||||||
|
local oil = require 'oil'
|
||||||
|
oil.setup(opts)
|
||||||
|
end,
|
||||||
|
init = function()
|
||||||
|
vim.api.nvim_create_autocmd('BufEnter', {
|
||||||
|
desc = 'Detect buffer and setup oil nnn flag',
|
||||||
|
-- group = aug,
|
||||||
|
pattern = '*',
|
||||||
|
nested = true,
|
||||||
|
callback = function(params)
|
||||||
|
local bufnr = params.buf
|
||||||
|
local _, filetype = pcall(vim.api.nvim_get_option_value, 'filetype', { buf = bufnr })
|
||||||
|
if filetype == 'oil' then
|
||||||
|
local val = require('fancyutil').get_oil_nnn(bufnr)
|
||||||
|
if val == nil then
|
||||||
|
vim.api.nvim_buf_set_var(bufnr, 'nnn', true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ return {
|
||||||
local schemastore = require 'schemastore'
|
local schemastore = require 'schemastore'
|
||||||
local lspconfig = require 'lspconfig'
|
local lspconfig = require 'lspconfig'
|
||||||
lspconfig.jsonls.setup {
|
lspconfig.jsonls.setup {
|
||||||
settigns = {
|
settings = {
|
||||||
json = {
|
json = {
|
||||||
schemas = schemastore.json.schemas(),
|
schemas = schemastore.json.schemas(),
|
||||||
validate = {
|
validate = {
|
||||||
|
@ -18,7 +18,7 @@ return {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
lspconfig.yamlls.setup {
|
lspconfig.yamlls.setup {
|
||||||
settigns = {
|
settings = {
|
||||||
yaml = {
|
yaml = {
|
||||||
schemas = schemastore.yaml.schemas(),
|
schemas = schemastore.yaml.schemas(),
|
||||||
},
|
},
|
||||||
|
|
|
@ -16,10 +16,10 @@ return {
|
||||||
show_tabs_always = true, -- this shows tabs only when there are more than one tab or if the first tab is named
|
show_tabs_always = true, -- this shows tabs only when there are more than one tab or if the first tab is named
|
||||||
show_devicons = true, -- this shows devicons in buffer section
|
show_devicons = true, -- this shows devicons in buffer section
|
||||||
colored = true,
|
colored = true,
|
||||||
show_bufnr = false, -- this appends [bufnr] to buffer section,
|
show_bufnr = true, -- this appends [bufnr] to buffer section,
|
||||||
tabline_show_last_separator = true,
|
tabline_show_last_separator = true,
|
||||||
show_filename_only = true, -- shows base filename only instead of relative path in filename
|
show_filename_only = true, -- shows base filename only instead of relative path in filename
|
||||||
modified_icon = '+ ', -- change the default modified icon
|
modified_icon = 'single', -- change the default modified icon
|
||||||
modified_italic = true, -- set to true by default; this determines whether the filename turns italic if modified
|
modified_italic = true, -- set to true by default; this determines whether the filename turns italic if modified
|
||||||
show_tabs_only = false, -- this shows only tabs instead of tabs + buffers
|
show_tabs_only = false, -- this shows only tabs instead of tabs + buffers
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'folke/trouble.nvim',
|
||||||
|
opts = {
|
||||||
|
modes = {
|
||||||
|
preview_float = {
|
||||||
|
mode = 'diagnostics',
|
||||||
|
preview = {
|
||||||
|
type = 'float',
|
||||||
|
relative = 'editor',
|
||||||
|
border = 'rounded',
|
||||||
|
title = 'Preview',
|
||||||
|
title_pos = 'center',
|
||||||
|
position = { 0, -2 },
|
||||||
|
size = { width = 0.3, height = 0.3 },
|
||||||
|
zindex = 200,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
cmd = 'Trouble',
|
||||||
|
},
|
||||||
|
}
|
|
@ -20,7 +20,7 @@ return {
|
||||||
end, { desc = '[T]oggle [N]umbers' })
|
end, { desc = '[T]oggle [N]umbers' })
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>tw', function()
|
vim.keymap.set('n', '<leader>tw', function()
|
||||||
vim.opt.warp = not vim.opt.warp._value
|
vim.opt.wrap = not vim.opt.wrap._value
|
||||||
end, { desc = '[T]oggle [W]rap Lines' })
|
end, { desc = '[T]oggle [W]rap Lines' })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'gbprod/yanky.nvim',
|
||||||
|
opts = {
|
||||||
|
ystem_clipboard = {
|
||||||
|
sync_with_ring = true,
|
||||||
|
clipboard_register = nil,
|
||||||
|
},
|
||||||
|
highlight = {
|
||||||
|
on_put = true,
|
||||||
|
on_yank = true,
|
||||||
|
timer = 500,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
|
@ -17,7 +17,7 @@
|
||||||
commit_author: Some(Rgb(116, 199, 236)),
|
commit_author: Some(Rgb(116, 199, 236)),
|
||||||
danger_fg: Some(Rgb(243, 139, 168)),
|
danger_fg: Some(Rgb(243, 139, 168)),
|
||||||
push_gauge_bg: Some(Rgb(137, 180, 250)),
|
push_gauge_bg: Some(Rgb(137, 180, 250)),
|
||||||
push_gauge_fg: Some(Rgb(30, 30, 46)),
|
push_gauge_fg: some(Rgb(30, 30, 46)),
|
||||||
tag_fg: Some(Rgb(245, 224, 220)),
|
tag_fg: Some(Rgb(245, 224, 220)),
|
||||||
branch_fg: Some(Rgb(148, 226, 213))
|
branch_fg: Some(Rgb(148, 226, 213))
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue