separate jump to tag and jump to definition
This commit is contained in:
@@ -329,15 +329,11 @@ require'lazy'.setup{ --{{{1
|
|||||||
|
|
||||||
require'lspconfig'.gdscript.setup{}
|
require'lspconfig'.gdscript.setup{}
|
||||||
|
|
||||||
local function jump_to_definition()
|
local function jump_to_ctag()
|
||||||
-- try to find definition with ctags first
|
pcall(vim.cmd --[[@as fun(...): ...]], "tag " .. vim.fn.expand("<cword>"))
|
||||||
local tag_jump_success = pcall(vim.cmd --[[@as fun(...): ...]], "tag " .. vim.fn.expand("<cword>"))
|
|
||||||
-- otherwise, try with lsp
|
|
||||||
if not tag_jump_success then
|
|
||||||
vim.lsp.buf.definition()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
vim.keymap.set( 'n', ',fd', jump_to_definition, { noremap = true, })
|
vim.keymap.set( 'n', '<c-]>', jump_to_ctag, { noremap = true, })
|
||||||
|
vim.keymap.set( 'n', ',fd', vim.lsp.buf.definition, { noremap = true, })
|
||||||
|
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
noremap ,rn :lua vim.lsp.buf.rename()<CR>
|
noremap ,rn :lua vim.lsp.buf.rename()<CR>
|
||||||
|
|||||||
Reference in New Issue
Block a user