Don't lose the audience when screen sharing—make things stand out by putting them in the spotlight.
spotlight.nvim.demo.mp4
spotlight.nvim has a default plugin spec—see lazy.lua
. This spec
has a set default mappings and lazy loading enabled!
---@module "lazy"
---@type LazySpec
{
"TymekDev/spotlight.nvim"
---@module "spotlight"
---@type spotlight.ConfigPartial
opts = {},
}
Tip
Annotations above are optional. Use lazydev.nvim to get completions based on them.
All configurable settings with their defaults:
require("spotlight").setup({
-- Should the spotlights have their ordinal number displayed in the sign column?
-- Every buffer has its own counter.
count = true,
-- The highlight group applied to the spotlighted lines
hl_group = "Visual",
})
Put a range of lines in the spotlight! ✨
:Spotlight
- puts the current line:<range>Spotlight
- puts the provided range as one:Spotlight count=false hl_group=SpellBad
- overrides the config
Remove a range of lines, a buffer, or everything from the spotlight. ♻️
:SpotlightClear
- clears everything overlapping with the current line:<range>SpotlightClear
- clears everything overlapping with the provided range:Spotlight Clear buffer
- clears the entire buffer and resets the counter:Spotlight Clear global
- clears every buffer and resets their counters
I got Highlight specific lines linked by Damian. Then I nerd sniped myself into converting the snippet to Lua. Then into extending it. Then into using extmarks. Then into turning the script into a plugin. Then...