A neovim plugin for LSP Document Highlight. Automatically highlighting other references of the word under the cursor by LSP.
- Automatically highlighting other references of the word under the cursor.
- Reduce flicker and LSP requests when move the cursor in the references.
with vim.pack
vim.pack.add({ "https://github.com/allworldg/doc-highlight" }, { confirm = false })
with lazy.nvim
{"allworldg/doc-highlight"}
copy
This plugin code is very simple, and all the code is in the lua/doc-highlight.lua, so you can easily just copy code
and put it in your config.
Remember to call require("doc-highlight").setup() to enable it.
Highlight group used for references.
vim.api.nvim_set_hl(0,'DocHighlight',{bg=xxx,fg=xxx})
- Builtin document highlight in Neovim, see
:h vim.lsp.buf.document_highlight() - vim-illuminate
