Add keyboard shortcut for "open_float" in loadlsp

Ctrl-D on a line with diagnostic will open a floating window with that
diagnostic (when lsp is enabled).
This commit is contained in:
Stephen Seo 2024-02-22 14:14:52 +09:00
parent 97cefacb6b
commit ab25b5a959

View file

@ -138,6 +138,8 @@ vim.api.nvim_set_keymap("n", "<C-A>", "<cmd>lua vim.lsp.buf.code_action()<CR>",
--vim.api.nvim_set_keymap("n", "<C-N>", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", {noremap = true}) --vim.api.nvim_set_keymap("n", "<C-N>", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", {noremap = true})
vim.api.nvim_set_keymap("n", "<C-N>", "<cmd>lua vim.diagnostic.goto_next()<CR>", {noremap = true}) vim.api.nvim_set_keymap("n", "<C-N>", "<cmd>lua vim.diagnostic.goto_next()<CR>", {noremap = true})
vim.api.nvim_set_keymap("n", "<C-P>", "<cmd>lua vim.diagnostic.goto_prev()<CR>", {noremap = true}) vim.api.nvim_set_keymap("n", "<C-P>", "<cmd>lua vim.diagnostic.goto_prev()<CR>", {noremap = true})
-- Get diagnostic on currently selected
vim.api.nvim_set_keymap("n", "<C-D>", "<cmd>lua vim.diagnostic.open_float()<CR>", {noremap = true})
EOF EOF