Skip to content

Commit

Permalink
Use + for LSP document highlight and clear on cursor move
Browse files Browse the repository at this point in the history
  • Loading branch information
dietrichm committed Oct 11, 2023
1 parent 8761c67 commit 2262349
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nvim/.config/nvim/lua/dietrichm/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ local on_attach = function(_, bufnr)
map('i', '<C-S>', vim.lsp.buf.signature_help)
map('n', '<Leader>rn', vim.lsp.buf.rename)
map('n', '<Leader>lf', vim.lsp.buf.format)
map('n', '+', vim.lsp.buf.document_highlight)

-- Avoid jumping text when (diagnostic) signs are (un)set.
vim.opt_local.signcolumn = 'yes'

vim.api.nvim_create_autocmd('CursorMoved', {
group = 'vimrc',
buffer = bufnr,
callback = vim.lsp.buf.clear_references,
})

vim.api.nvim_buf_create_user_command(
bufnr,
'LspSwitch',
Expand Down

0 comments on commit 2262349

Please sign in to comment.