diff options
author | Daniel Schadt <kingdread@gmx.de> | 2022-02-03 14:39:59 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2022-02-03 14:39:59 +0100 |
commit | a41a51db0fe0ef805bfd43af793f70c5350dbd91 (patch) | |
tree | a45acfc91113e14d9d81ea59178eef76e472fa3d /neovim/.config/nvim/init.vim | |
parent | 55a96e603cc3bcba5502461a6260692f0c032a2b (diff) | |
download | dotfiles-a41a51db0fe0ef805bfd43af793f70c5350dbd91.tar.gz dotfiles-a41a51db0fe0ef805bfd43af793f70c5350dbd91.tar.bz2 dotfiles-a41a51db0fe0ef805bfd43af793f70c5350dbd91.zip |
nvim: adjust to new LSP commands
Diffstat (limited to 'neovim/.config/nvim/init.vim')
-rw-r--r-- | neovim/.config/nvim/init.vim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/neovim/.config/nvim/init.vim b/neovim/.config/nvim/init.vim index e5b2933..45e1ece 100644 --- a/neovim/.config/nvim/init.vim +++ b/neovim/.config/nvim/init.vim @@ -189,6 +189,12 @@ cmp.setup({ -- Setup the actual language servers local nvim_lsp = require('lspconfig') +local opts = { noremap=true, silent=true } +vim.api.nvim_set_keymap('n', '<space>e', '<cmd>lua vim.diagnostic.open_float()<CR>', opts) +vim.api.nvim_set_keymap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts) +vim.api.nvim_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) +vim.api.nvim_set_keymap('n', '<space>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts) + -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer local on_attach = function(client, bufnr) @@ -199,8 +205,6 @@ local on_attach = function(client, bufnr) buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') -- Mappings. - local opts = { noremap=true, silent=true } - -- See `:help vim.lsp.*` for documentation on any of the below functions buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) buf_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) @@ -214,10 +218,6 @@ local on_attach = function(client, bufnr) buf_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts) buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts) buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts) - buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts) - buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts) - buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts) - buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts) buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts) lsp_status.on_attach(client) @@ -235,7 +235,7 @@ for _, lsp in ipairs(servers) do capabilities = require('cmp_nvim_lsp').update_capabilities(lsp_status.capabilities) } if lsp == 'pylsp' then - config['cmd'] = { 'pyls' } + config['settings'] = {pylsp = {plugins = {pylint = {enabled = true}}}} end if lsp == 'rust_analyzer' then require('rust-tools').setup({server = config}) |