From 4483b7077cec05cbfc860422acffd761fe3348a2 Mon Sep 17 00:00:00 2001 From: Ivar Fatland Date: Thu, 10 Apr 2025 11:16:27 +0200 Subject: [PATCH] separate jump to tag and jump to definition --- init.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 5252f8a..ddf94db 100644 --- a/init.lua +++ b/init.lua @@ -329,15 +329,11 @@ require'lazy'.setup{ --{{{1 require'lspconfig'.gdscript.setup{} - local function jump_to_definition() - -- try to find definition with ctags first - local tag_jump_success = pcall(vim.cmd --[[@as fun(...): ...]], "tag " .. vim.fn.expand("")) - -- otherwise, try with lsp - if not tag_jump_success then - vim.lsp.buf.definition() - end + local function jump_to_ctag() + pcall(vim.cmd --[[@as fun(...): ...]], "tag " .. vim.fn.expand("")) end - vim.keymap.set( 'n', ',fd', jump_to_definition, { noremap = true, }) + vim.keymap.set( 'n', '', jump_to_ctag, { noremap = true, }) + vim.keymap.set( 'n', ',fd', vim.lsp.buf.definition, { noremap = true, }) vim.cmd [[ noremap ,rn :lua vim.lsp.buf.rename()