A Neovim plugin to highlight the current identifier under the cursor.
Packer:
use 'David-Kunz/spotlight'
require('spotlight').run()
require('spotlight').setup(options)
with the following options (with defaults):
options = {
hl_group = 'LspReferenceText', -- highlight group
highlight_at_cursor = true -- also highlight the word under the cursor
}
To automatically run it after the cursor was moved:
- instantaneously:
vim.api.nvim_create_autocmd("CursorMoved", {callback = require('spotlight').run})
- with a small delay:
vim.api.nvim_create_autocmd("CursorHold", {callback = require('spotlight').run})