keymap to jump to next/previous function

main
Mathias Rothenhaeusler 2024-10-07 08:57:33 +02:00
parent 76c98ecc30
commit 66ffd49dd6
1 changed files with 7 additions and 5 deletions

View File

@ -69,13 +69,15 @@ local on_attach = function(_, bufnr)
keymap.set("n", "ge", "<cmd>Lspsaga show_line_diagnostics<CR>", opts) -- show diagnostics for line keymap.set("n", "ge", "<cmd>Lspsaga show_line_diagnostics<CR>", opts) -- show diagnostics for line
keymap.set("n", "<a-cr>", "<cmd>Lspsaga code_action<CR>", opts) keymap.set("n", "<a-cr>", "<cmd>Lspsaga code_action<CR>", opts)
-- diagnostic -- diagnostic
keymap.set("n", "<leader>d", "<cmd>Telescope diagnostics<CR>", opts) -- jump to previous diagnostic in buffer keymap.set("n", "<leader>d", "<cmd>Telescope diagnostics<CR>", opts) -- jump to previous diagnostic in buffer
-- keymap.set("n", "<leader>d", "<cmd>Lspsaga show_buf_diagnostics<CR>") -- 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>dn", "<cmd>Lspsaga diagnostic_jump_next<CR>") -- jump to next diagnostic in buffer
keymap.set("n", "<leader>dp", "<cmd>Lspsaga diagnostic_jump_prev<CR>") -- jump to previous diagnostic in buffer keymap.set("n", "<leader>dp", "<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", "gj", "<cmd>lua require'nvim-treesitter.textobjects.move'.goto_next_start('@function.outer')<CR>",
keymap.set("n", "gk", "[m", opts) -- jump to previous method opts) -- jump to next method
keymap.set("n", "gk", "<cmd>lua require'nvim-treesitter.textobjects.move'.goto_previous_start('@function.outer')<CR>",
opts) -- jump to previous method
end end
-- used to enable autocompletion (assign to every lsp server config) -- used to enable autocompletion (assign to every lsp server config)