map return and shift return to jump lsp definitions

This commit is contained in:
Oliver Hartmann 2024-11-19 08:02:17 +00:00
parent 000a7051f1
commit ea7760b0ff
2 changed files with 16 additions and 11 deletions

View File

@ -85,17 +85,6 @@ local on_attach = function(client, bufnr)
lspKeys(client, bufnr)
if client.server_capabilities.documentHighlightProvider then
vim.keymap.set(
'n',
'<return>',
function ()
vim.lsp.buf.clear_references()
vim.lsp.buf.document_highlight()
end,
vim.tbl_extend('error', { noremap = true, silent = false, buffer = bufnr }, { desc = 'Document highlight' })
)
end
if client.server_capabilities.documentSymbolProvider then
local navic = require('nvim-navic')
navic.attach(client, bufnr)

View File

@ -36,5 +36,21 @@ return {
end,
desc = 'Lazygit Log (cwd)',
},
{
'<return>',
function()
Snacks.words.jump(vim.v.count1)
end,
desc = 'Next Reference',
mode = { 'n' },
},
{
'<S-CR>',
function()
Snacks.words.jump(-vim.v.count1)
end,
desc = 'Prev Reference',
mode = { 'n' },
},
},
}