keymaps lsp

main
Mathias Rothenhaeusler 2024-03-27 11:56:49 +01:00
parent b8776f785e
commit e438717557
1 changed files with 11 additions and 9 deletions

View File

@ -60,18 +60,20 @@ local on_attach = function(_, bufnr)
-- LSP Saga
keymap.set("n", "gsd", "<cmd>Lspsaga peek_definition<CR>", opts) -- see definition and make edits in window
keymap.set("n", "gr", "<cmd>Lspsaga finder<CR>", opts) -- see definition and make edits in window
keymap.set("n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opts) -- smart rename
keymap.set("n", "gsd", "<cmd>Lspsaga peek_definition<CR>", opts) -- see definition and make edits in window
keymap.set("n", "gr", "<cmd>Lspsaga finder<CR>", opts) -- see definition and make edits in window
keymap.set("n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opts) -- smart rename
keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<CR>", opts) -- see available code actions
keymap.set("n", "<leader>en", "<cmd>Lspsaga diagnostic_jump_next<CR>") -- jump to next diagnostic in buffer
keymap.set("n", "K", "<cmd>Lspsaga hover_doc<CR>", opts) -- show documentation for what is under cursor
keymap.set("n", "<leader>eb", "<cmd>Lspsaga diagnostic_jump_prev<CR>") -- jump to previous diagnostic in buffer
keymap.set("n", "K", "<cmd>Lspsaga hover_doc<CR>", opts) -- show documentation for what is under cursor
keymap.set("n", "ge", "<cmd>Lspsaga show_line_diagnostics<CR>", opts) -- show diagnostics for line
keymap.set("n", "<leader>d", "<cmd>Lspsaga show_buf_diagnostics<CR>")
keymap.set("n", "<a-cr>", "<cmd>Lspsaga code_action<CR>", opts)
keymap.set("n", "gj", "]m", opts) -- jump to next method
keymap.set("n", "gk", "[m", opts) -- jump to previous method
-- diagnostic
keymap.set("n", "<leader>d", "<cmd>Lspsaga show_buf_diagnostics<CR>")
keymap.set("n", "<leader>dn", "<cmd>Lspsaga diagnostic_jump_next<CR>") -- jump to next diagnostic in buffer
keymap.set("n", "<leader>db", "<cmd>Lspsaga diagnostic_jump_prev<CR>") -- jump to previous diagnostic in buffer
keymap.set("n", "gj", "]m", opts) -- jump to next method
keymap.set("n", "gk", "[m", opts) -- jump to previous method
end
-- used to enable autocompletion (assign to every lsp server config)