https://github.com/david-kunz/spotlight
A Neovim plugin to highlight the current identifier under the cursor.
https://github.com/david-kunz/spotlight
extension lua neovim plugin
Last synced: about 1 month ago
JSON representation
A Neovim plugin to highlight the current identifier under the cursor.
- Host: GitHub
- URL: https://github.com/david-kunz/spotlight
- Owner: David-Kunz
- License: unlicense
- Created: 2022-11-23T17:49:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-01T21:24:16.000Z (over 3 years ago)
- Last Synced: 2025-02-24T17:17:40.391Z (over 1 year ago)
- Topics: extension, lua, neovim, plugin
- Language: Lua
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spotlight
A Neovim plugin to highlight the current identifier under the cursor.
## Installation
Packer:
```lua
use 'David-Kunz/spotlight'
```
## Usage
```lua
require('spotlight').run()
```
## Options
```lua
require('spotlight').setup(options)
```
with the following options (with defaults):
```lua
options = {
hl_group = 'LspReferenceText', -- highlight group
highlight_at_cursor = true -- also highlight the word under the cursor
}
```
## Tip
To automatically run it after the cursor was moved:
- instantaneously:
```lua
vim.api.nvim_create_autocmd("CursorMoved", {callback = require('spotlight').run})
```
- with a small delay:
```lua
vim.api.nvim_create_autocmd("CursorHold", {callback = require('spotlight').run})
```