highlight with return

This commit is contained in:
Oliver Hartmann 2024-07-11 06:02:15 +00:00
parent 2cfa266df3
commit 010acd113f

View File

@ -86,7 +86,15 @@ local on_attach = function(client, bufnr)
lspKeys(client, bufnr) lspKeys(client, bufnr)
if client.server_capabilities.documentHighlightProvider then if client.server_capabilities.documentHighlightProvider then
document_highlight(bufnr) 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 end
if client.server_capabilities.documentSymbolProvider then if client.server_capabilities.documentSymbolProvider then
local navic = require('nvim-navic') local navic = require('nvim-navic')