Rewrites lingering github.com / *.sr.ht references to this Gitea instance, translating GitHub and Sourcehut URL shapes to Gitea's (/blob/<ref>/ and sr.ht /tree/<ref>/item/ -> /src/branch/<ref>/, /tree/<tag> -> /src/tag/<tag>, /actions/workflows/X -> /actions?workflow=X, /edit/ -> /_edit/). Left pointing at the old hosts on purpose: pull-request links (PRs were not migrated), forks that were never migrated, and GitHub-only surfaces Gitea lacks. OpenPGP identity proofs are untouched by design.
64 lines
1.5 KiB
Markdown
64 lines
1.5 KiB
Markdown
# tiny-lightbulb.nvim
|
|
|
|
A tiny lightbulb for Neovim 0.12+. Shows a sign when LSP code actions are
|
|
available on the current line.
|
|
|
|
Zero config. ~40 lines of Lua.
|
|
|
|
## Features
|
|
|
|
- Displays a 💡 in the sign column when code actions are available
|
|
- Clears instantly on cursor move
|
|
- Async LSP requests with stale-response handling
|
|
- Configurable sign text and highlight group
|
|
- Works out of the box — no setup call required
|
|
|
|
## Requirements
|
|
|
|
- Neovim >= 0.12
|
|
- At least one LSP server that supports code actions
|
|
|
|
## Installation
|
|
|
|
Add to your `vim.pack.add()` call:
|
|
|
|
```lua
|
|
"https://git.swaits.com/swaits/tiny-lightbulb.nvim",
|
|
```
|
|
|
|
Done. The plugin auto-loads with sensible defaults.
|
|
|
|
## Recommended setup
|
|
|
|
To prevent the gutter from expanding and contracting as the lightbulb
|
|
appears and disappears, reserve the sign column width up front:
|
|
|
|
```lua
|
|
vim.o.signcolumn = "yes:2" -- room for a diagnostic + the lightbulb
|
|
```
|
|
|
|
Without this, Neovim's default `auto` behavior will shift your text left
|
|
and right as signs come and go.
|
|
|
|
## Configuration
|
|
|
|
All options are optional. Call `setup()` only if you want to customize:
|
|
|
|
```lua
|
|
require("tiny-lightbulb").setup({
|
|
sign = "💡", -- sign column text
|
|
hl = "DiagnosticWarn", -- highlight group
|
|
})
|
|
```
|
|
|
|
## How it works
|
|
|
|
On `CursorHold`, the plugin asks all attached LSP clients whether code
|
|
actions exist for the current line. If any are returned, an extmark sign
|
|
is placed. On `CursorMoved`, the sign is cleared and any in-flight LSP
|
|
responses are discarded via a generation counter.
|
|
|
|
## License
|
|
|
|
[MIT](LICENSE)
|