update nvim

This commit is contained in:
ksyasuda 2022-04-15 23:21:17 -07:00
parent 997cd34645
commit 9b80bee1d5
5 changed files with 169 additions and 162 deletions

View File

@ -1,7 +1,7 @@
syntax enable syntax enable
filetype plugin on filetype plugin on
set noshowmode "disable default vim insert text at bottom set noshowmode "disable default vim insert text at bottom
set laststatus=2 set laststatus=3
set number set number
set colorcolumn=80 set colorcolumn=80
set tw=80 set tw=80
@ -79,6 +79,8 @@ if has('nvim')
Plug 'nvim-lua/plenary.nvim' Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-lua/popup.nvim' Plug 'nvim-lua/popup.nvim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
" Plug 'zbirenbaum/copilot.lua'
" Plug 'zbirenbaum/copilot-cmp'
" Plug 'nvim-telescope/telescope.nvim' " Plug 'nvim-telescope/telescope.nvim'
" Plug 'TimUntersberger/neogit' " Plug 'TimUntersberger/neogit'
@ -153,6 +155,7 @@ if has('nvim')
source ~/.config/nvim/plugin-confs/whichkey.lua source ~/.config/nvim/plugin-confs/whichkey.lua
source ~/.config/nvim/plugin-confs/code_actions.lua source ~/.config/nvim/plugin-confs/code_actions.lua
" source ~/.config/nvim/plugin-confs/copilot.lua
source ~/.config/nvim/plugin-confs/goto-preview.lua source ~/.config/nvim/plugin-confs/goto-preview.lua
source ~/.config/nvim/plugin-confs/lsp-kind.lua source ~/.config/nvim/plugin-confs/lsp-kind.lua
source ~/.config/nvim/plugin-confs/lsp-signature.lua source ~/.config/nvim/plugin-confs/lsp-signature.lua

View File

@ -5,10 +5,10 @@ nmap <F5> :!
vnoremap < <gv vnoremap < <gv
vnoremap > >gv vnoremap > >gv
" for toggling/hiding the vsplit-term " for toggling/hiding the split-term
tnoremap <C-T> <C-\><C-n>:FloatermToggle floatingterm<CR> tnoremap <C-T> <C-\><C-n>:FloatermToggle floatingterm<CR>
tnoremap <Esc> <C-\><C-n> tnoremap <Esc> <C-\><C-n>
tnoremap <leader>tt <C-\><C-N>:FloatermToggle vsplit-term<CR> tnoremap <leader>tt <C-\><C-N>:FloatermToggle split-term<CR>
nmap <C-J> :bnext<CR> nmap <C-J> :bnext<CR>
nmap <C-K> :bprev<CR> nmap <C-K> :bprev<CR>
@ -91,9 +91,10 @@ nmap <leader>n :NvimTreeToggle<CR>
nmap <leader>ob :FloatermNew --title=bpytop --opener=vsplit bpytop<CR> nmap <leader>ob :FloatermNew --title=bpytop --opener=vsplit bpytop<CR>
nmap <leader>od :FloatermNew --title=lazydocker --opener=vsplit lazydocker<CR> nmap <leader>od :FloatermNew --title=lazydocker --opener=vsplit lazydocker<CR>
nmap <leader>oh :FloatermNew --title=floaterm --name=split-term --opener=edit --wintype=split --position=botright --height=0.45<CR>
nmap <leader>on :FloatermNew --title=ncmpcpp --opener=vsplit ncmpcpp<CR> nmap <leader>on :FloatermNew --title=ncmpcpp --opener=vsplit ncmpcpp<CR>
nmap <leader>or :FloatermNew --title=ranger --opener=vsplit ranger --cmd="cd $PWD"<CR> nmap <leader>or :FloatermNew --title=ranger --opener=vsplit ranger --cmd="cd $PWD"<CR>
nmap <leader>ot :FloatermNew --title=floaterm --name=vsplit-term --opener=edit --wintype=vsplit --position=botright --width=0.5<CR> nmap <leader>ot :FloatermNew --title=floaterm --name=split-term --opener=edit --wintype=vsplit --position=botright --width=0.5<CR>
nmap <leader>r :NvimTreeRefresh<CR> nmap <leader>r :NvimTreeRefresh<CR>
@ -107,7 +108,7 @@ nmap <leader>s/ :History/<CR>
nnoremap <silent> <Leader>tc :DashboardChangeColorscheme<CR> nnoremap <silent> <Leader>tc :DashboardChangeColorscheme<CR>
nmap <leader>to :SymbolsOutline<CR> nmap <leader>to :SymbolsOutline<CR>
nmap <leader>tt :FloatermToggle vsplit-term<CR> nmap <leader>tt :FloatermToggle split-term<CR>
nmap <leader>wa :lua vim.lsp.buf.add_workspace_folder()<CR> nmap <leader>wa :lua vim.lsp.buf.add_workspace_folder()<CR>
nmap <leader>wl :lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR> nmap <leader>wl :lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>

View File

@ -176,7 +176,7 @@ end)
-- Use a loop to conveniently call 'setup' on multiple servers and -- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches -- map buffer local keybindings when the language server attaches
local servers = { 'pyright', 'bashls', 'vimls', 'yamlls', 'dockerls', 'html', 'sumneko_lua', 'dotls', 'rust_analyzer', 'clangd' } local servers = { 'pyright', 'bashls', 'vimls', 'yamlls', 'dockerls', 'html', 'sumneko_lua', 'dotls', 'rust_analyzer', 'clangd', 'ansiblels' }
for _, lsp in pairs(servers) do for _, lsp in pairs(servers) do
require('lspconfig')[lsp].setup { require('lspconfig')[lsp].setup {
on_attach = on_attach, on_attach = on_attach,

View File

@ -13,35 +13,36 @@ require("null-ls").setup({
end end
end, end,
sources = { sources = {
require("null-ls").builtins.completion.spell, null_ls.builtins.completion.spell,
require("null-ls").builtins.completion.luasnip, null_ls.builtins.completion.luasnip,
require("null-ls").builtins.code_actions.gitsigns, null_ls.builtins.code_actions.gitsigns,
require("null-ls").builtins.code_actions.shellcheck, null_ls.builtins.code_actions.shellcheck,
require("null-ls").builtins.diagnostics.cppcheck, null_ls.builtins.diagnostics.cppcheck,
require("null-ls").builtins.diagnostics.gitlint, null_ls.builtins.diagnostics.gitlint,
require("null-ls").builtins.diagnostics.jsonlint, null_ls.builtins.diagnostics.jsonlint,
-- require("null-ls").builtins.diagnostics.luacheck, -- require("null-ls").builtins.diagnostics.luacheck,
require("null-ls").builtins.diagnostics.markdownlint, null_ls.builtins.diagnostics.markdownlint,
require("null-ls").builtins.diagnostics.pylint, null_ls.builtins.diagnostics.pylint,
require("null-ls").builtins.diagnostics.pydocstyle.with({ null_ls.builtins.diagnostics.pydocstyle.with({
extra_args = { "--config=$ROOT/setup.cfg" } extra_args = { "--config=$ROOT/setup.cfg" }
}), }),
require("null-ls").builtins.diagnostics.vint, null_ls.builtins.diagnostics.vint,
require("null-ls").builtins.formatting.json_tool, null_ls.builtins.diagnostics.shellcheck.with({
extra_args = { "-s", "bash", "-o", "add-default-case, check-set-e-suppressed, check-unassigned-uppercase, deprecate-which, quote-safe-variables" }
}),
null_ls.builtins.diagnostics.ansiblelint,
null_ls.builtins.formatting.json_tool,
-- require("null-ls").builtins.formatting.lua_format, -- require("null-ls").builtins.formatting.lua_format,
require("null-ls").builtins.formatting.markdownlint, null_ls.builtins.formatting.markdownlint,
require("null-ls").builtins.formatting.prettier, null_ls.builtins.formatting.prettier,
-- handled by lsp server -- handled by lsp server
-- require("null-ls").builtins.formatting.rustfmt, -- require("null-ls").builtins.formatting.rustfmt,
require("null-ls").builtins.formatting.shfmt.with({ null_ls.builtins.formatting.shfmt.with({
filetypes = { "sh", "bash" }, filetypes = { "sh", "bash" },
extra_args = { "-i", "0", "-ci", "-sr" } extra_args = { "-i", "0", "-ci", "-sr" }
}), }),
require("null-ls").builtins.diagnostics.shellcheck.with({ null_ls.builtins.formatting.black,
extra_args = { "-s", "bash", "-o", "check-extra-masked-returns, check-set-e-suppressed, check-unassigned-uppercase, deprecate-which, quote-safe-variables" } null_ls.builtins.formatting.isort,
}),
require("null-ls").builtins.formatting.black,
require("null-ls").builtins.formatting.isort,
}, },
}) })

View File

@ -73,9 +73,11 @@ cmp.setup({
}) })
}, },
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = "copilot", group_index = 2 },
{ name = 'nvim_lsp', group_index = 2 },
-- { name = 'vsnip' }, -- For vsnip users. -- { name = 'vsnip' }, -- For vsnip users.
{ name = 'luasnip' }, -- For luasnip users. { name = "path", group_index = 2 },
{ name = 'luasnip', group_index = 2 }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users. -- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users. -- { name = 'snippy' }, -- For snippy users.
}, { }, {