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

@ -74,8 +74,10 @@ local on_attach = function(_, bufnr)
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", "gj", "]m", opts) -- jump to next method
keymap.set("n", "gk", "[m", opts) -- jump to previous method
keymap.set("n", "gj", "<cmd>lua require'nvim-treesitter.textobjects.move'.goto_next_start('@function.outer')<CR>",
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
-- used to enable autocompletion (assign to every lsp server config)