new: Added new LSP related keymaps

This commit is contained in:
Sayantan Santra 2025-03-27 01:39:44 -05:00
parent af4037dac1
commit d987981adb
Signed by: SinTan1729
GPG key ID: 0538DD402EA50898
3 changed files with 23 additions and 3 deletions

View file

@ -22,12 +22,18 @@ lspconfig.ocamllsp.setup {}
lspconfig.hls.setup {}
-- Set ;k to hover and ;a to show code actions
-- ;k to hover
-- ;a to show code actions
-- ;d to show diagnostic message
-- ;n to go to next diagnostic message
-- ;N to go to previous diagnostic message
vim.api.nvim_create_autocmd("LspAttach", {
callback = function()
map('n', '<localleader>k', vim.lsp.buf.hover, { remap = false })
map('n', '<localleader>a', vim.lsp.buf.code_action, { remap = false })
map('n', '<localleader>d', vim.diagnostic.open_float, { remap = false })
map('n', '<localleader>n', vim.diagnostic.goto_next, { remap = false })
map('n', '<localleader>N', vim.diagnostic.goto_prev, { remap = false })
end,
})

View file

@ -12,10 +12,17 @@ local lspconfig = require('lspconfig')
-- },
-- }
-- Set ;k to hover and ;a to show code actions
-- ;k to hover
-- ;a to show code actions
-- ;d to show diagnostic message
-- ;n to go to next diagnostic message
-- ;N to go to previous diagnostic message
vim.api.nvim_create_autocmd("LspAttach", {
callback = function()
map('n', '<localleader>k', vim.lsp.buf.hover, { remap = false })
map('n', '<localleader>a', vim.lsp.buf.code_action, { remap = false })
map('n', '<localleader>d', vim.diagnostic.open_float, { remap = false })
map('n', '<localleader>n', vim.diagnostic.goto_next, { remap = false })
map('n', '<localleader>N', vim.diagnostic.goto_prev, { remap = false })
end,
})

View file

@ -12,10 +12,17 @@ local lspconfig = require('lspconfig')
-- },
-- }
-- Set ;k to hover and ;a to show code actions
-- ;k to hover
-- ;a to show code actions
-- ;d to show diagnostic message
-- ;n to go to next diagnostic message
-- ;N to go to previous diagnostic message
vim.api.nvim_create_autocmd("LspAttach", {
callback = function()
map('n', '<localleader>k', vim.lsp.buf.hover, { remap = false })
map('n', '<localleader>a', vim.lsp.buf.code_action, { remap = false })
map('n', '<localleader>d', vim.diagnostic.open_float, { remap = false })
map('n', '<localleader>n', vim.diagnostic.goto_next, { remap = false })
map('n', '<localleader>N', vim.diagnostic.goto_prev, { remap = false })
end,
})