Update commands according to changes in Neovim's Lua API

From version 0.5 to 0.6 some changes in Neovim's Lua API occurred, and
some settings had stopped working.  These changes are made to ensure
shortcuts and some stuff continues working on newer versions of Neovim.
Legacy behaviour was not considered and hence this configs may no longer
work on older stable versions of Neovim.
This commit is contained in:
Dionisio E Alonso 2022-01-07 17:37:19 -03:00
parent 3d3756176a
commit d4b2afb8da
1 changed files with 9 additions and 9 deletions

View File

@ -1,8 +1,8 @@
" nvim-lspconfig
sign define LspDiagnosticsSignError text=texthl=LspDiagnosticsSignError linehl= numhl=
sign define LspDiagnosticsSignWarning text=texthl=LspDiagnosticsSignWarning linehl= numhl=
sign define LspDiagnosticsSignInformation text= texthl=LspDiagnosticsSignInformation linehl= numhl=
sign define LspDiagnosticsSignHint text=texthl=LspDiagnosticsSignHint linehl= numhl=
sign define DiagnosticSignError text=texthl=DiagnosticSignError linehl= numhl=
sign define DiagnosticSignWarn text=texthl=DiagnosticSignWarn linehl= numhl=
sign define DiagnosticSignInfo text= texthl=DiagnosticSignInfo linehl= numhl=
sign define DiagnosticSignHint text=texthl=DiagnosticSignHint linehl= numhl=
set completeopt=menuone,noinsert,noselect
@ -28,10 +28,10 @@ lsp_mappings = function()
buf_set_keymap("n", "g0", "<cmd>lua vim.lsp.buf.document_symbol()<CR>", opts)
buf_set_keymap("n", "gW", "<cmd>lua vim.lsp.buf.workspace_symbol()<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>e", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
buf_set_keymap("n", "[d", "<cmd>lua vim.diagnostic.goto_prev()<CR>", opts)
buf_set_keymap("n", "]d", "<cmd>lua vim.diagnostic.goto_next()<CR>", opts)
buf_set_keymap("n", "<space>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
end
EOF
@ -46,7 +46,7 @@ lua << EOF
local nvim_lsp = require("lspconfig")
local on_attach = function(client, bufnr)
vim.api.nvim_command("autocmd CursorHoldI <buffer> lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false})")
vim.api.nvim_command("autocmd CursorHoldI <buffer> lua vim.diagnostic.open_float({show_header = false})")
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
update_in_insert = true,