docs: add gitsigns blame popup highlighting to README and vimdoc

This commit is contained in:
Barrett Ruth 2026-03-06 08:41:01 -05:00
parent e042ca35a8
commit 82dbb848ab
2 changed files with 52 additions and 10 deletions

View file

@ -16,6 +16,7 @@ with language-aware syntax highlighting.
word-level accuracy) word-level accuracy)
- `:Gdiff` unified diff against any revision - `:Gdiff` unified diff against any revision
- Inline merge conflict detection, highlighting, and resolution - Inline merge conflict detection, highlighting, and resolution
- gitsigns.nvim blame popup highlighting
- Email quoting/patch syntax support (`> diff ...`) - Email quoting/patch syntax support (`> diff ...`)
- Vim syntax fallback - Vim syntax fallback
- Configurable highlighiting blend & priorities - Configurable highlighiting blend & priorities
@ -58,14 +59,15 @@ luarocks install diffs.nvim
Do not lazy load `diffs.nvim` with `event`, `lazy`, `ft`, `config`, or `keys` to Do not lazy load `diffs.nvim` with `event`, `lazy`, `ft`, `config`, or `keys` to
control loading - `diffs.nvim` lazy-loads itself. control loading - `diffs.nvim` lazy-loads itself.
**Q: Does diffs.nvim support vim-fugitive/Neogit?** **Q: Does diffs.nvim support vim-fugitive/Neogit/gitsigns?**
Yes. Enable it in your config: Yes. Enable integrations in your config:
```lua ```lua
vim.g.diffs = { vim.g.diffs = {
fugitive = true, fugitive = true,
neogit = true, neogit = true,
gitsigns = true,
} }
``` ```
@ -119,4 +121,5 @@ See the documentation for more information.
- [`git-conflict.nvim`](https://github.com/akinsho/git-conflict.nvim) - [`git-conflict.nvim`](https://github.com/akinsho/git-conflict.nvim)
- [@phanen](https://github.com/phanen) - diff header highlighting, unknown - [@phanen](https://github.com/phanen) - diff header highlighting, unknown
filetype fix, shebang/modeline detection, treesitter injection support, filetype fix, shebang/modeline detection, treesitter injection support,
decoration provider highlighting architecture decoration provider highlighting architecture, blame_hl.nvim (gitsigns
blame popup highlighting inspiration)

View file

@ -15,6 +15,7 @@ Features: ~
- Diff header highlighting (`diff --git`, `index`, `---`, `+++`) - Diff header highlighting (`diff --git`, `index`, `---`, `+++`)
- Syntax highlighting in |:Gdiffsplit| / |:Gvdiffsplit| side-by-side diffs - Syntax highlighting in |:Gdiffsplit| / |:Gvdiffsplit| side-by-side diffs
- |:Gdiff| command for unified diff against any git revision - |:Gdiff| command for unified diff against any git revision
- gitsigns.nvim blame popup highlighting (see |diffs-gitsigns|)
- Background-only diff colors for any `&diff` buffer (vimdiff, diffthis, etc.) - Background-only diff colors for any `&diff` buffer (vimdiff, diffthis, etc.)
- Vim syntax fallback for languages without a treesitter parser - Vim syntax fallback for languages without a treesitter parser
- Blended diff background colors that preserve syntax visibility - Blended diff background colors that preserve syntax visibility
@ -35,12 +36,13 @@ CONTENTS *diffs-contents*
8. Conflict Resolution .................................... |diffs-conflict| 8. Conflict Resolution .................................... |diffs-conflict|
9. Merge Diff Resolution ..................................... |diffs-merge| 9. Merge Diff Resolution ..................................... |diffs-merge|
10. Neogit ................................................... |diffs-neogit| 10. Neogit ................................................... |diffs-neogit|
11. API ......................................................... |diffs-api| 11. Gitsigns ................................................ |diffs-gitsigns|
12. Implementation ................................... |diffs-implementation| 12. API ......................................................... |diffs-api|
13. Known Limitations ................................... |diffs-limitations| 13. Implementation ................................... |diffs-implementation|
14. Highlight Groups ..................................... |diffs-highlights| 14. Known Limitations ................................... |diffs-limitations|
15. Health Check ............................................. |diffs-health| 15. Highlight Groups ..................................... |diffs-highlights|
16. Acknowledgements ............................... |diffs-acknowledgements| 16. Health Check ............................................. |diffs-health|
17. Acknowledgements ............................... |diffs-acknowledgements|
============================================================================== ==============================================================================
REQUIREMENTS *diffs-requirements* REQUIREMENTS *diffs-requirements*
@ -78,6 +80,7 @@ Configuration is done via `vim.g.diffs`. Set this before the plugin loads:
hide_prefix = false, hide_prefix = false,
fugitive = false, fugitive = false,
neogit = false, neogit = false,
gitsigns = false,
extra_filetypes = {}, extra_filetypes = {},
highlights = { highlights = {
background = true, background = true,
@ -161,6 +164,16 @@ Configuration is done via `vim.g.diffs`. Set this before the plugin loads:
vim.g.diffs = { neogit = true } vim.g.diffs = { neogit = true }
< <
{gitsigns} (boolean|table, default: false)
Enable gitsigns.nvim blame popup highlighting.
Pass `true` or `{}` to enable, `false` to
disable. When active, `:Gitsigns blame_line`
popups receive treesitter syntax, line
backgrounds, and intra-line character diffs.
See |diffs-gitsigns|. >lua
vim.g.diffs = { gitsigns = true }
<
{extra_filetypes} (table, default: {}) {extra_filetypes} (table, default: {})
Additional filetypes to attach to, beyond the Additional filetypes to attach to, beyond the
built-in `git`, `gitcommit`, and any enabled built-in `git`, `gitcommit`, and any enabled
@ -650,6 +663,31 @@ line visuals. The overrides are reapplied on `ColorScheme` since Neogit
re-defines its groups then. When `neogit = false`, no highlight overrides re-defines its groups then. When `neogit = false`, no highlight overrides
are applied. are applied.
==============================================================================
GITSIGNS *diffs-gitsigns*
diffs.nvim can enhance gitsigns.nvim blame popups with syntax highlighting.
Enable gitsigns support in your config: >lua
vim.g.diffs = { gitsigns = true }
<
When `:Gitsigns blame_line full=true` opens a popup, diffs.nvim intercepts
the popup and replaces gitsigns' flat `GitSignsAddPreview`/
`GitSignsDeletePreview` highlights with:
- Treesitter syntax highlighting on the code content
- `DiffsAdd`/`DiffsDelete` line backgrounds
- Character-level intra-line diffs (`DiffsAddText`/`DiffsDeleteText`)
- `@diff.plus`/`@diff.minus` coloring on `+`/`-` prefix characters
The integration patches `gitsigns.popup.create` and `gitsigns.popup.update`
so highlights persist across gitsigns' two-phase render (initial popup, then
update with GitHub/PR data). If gitsigns loads after diffs.nvim, a
`User GitAttach` autocmd retries the setup automatically.
Highlights are applied in a separate `diffs-gitsigns` namespace and do not
interfere with the main decoration provider used for diff buffers.
============================================================================== ==============================================================================
API *diffs-api* API *diffs-api*
@ -878,7 +916,8 @@ ACKNOWLEDGEMENTS *diffs-acknowledgements*
- codediff.nvim (https://github.com/esmuellert/codediff.nvim) - codediff.nvim (https://github.com/esmuellert/codediff.nvim)
- diffview.nvim (https://github.com/sindrets/diffview.nvim) - diffview.nvim (https://github.com/sindrets/diffview.nvim)
- @phanen (https://github.com/phanen) - diff header highlighting, - @phanen (https://github.com/phanen) - diff header highlighting,
treesitter injection support treesitter injection support, blame_hl.nvim (gitsigns blame popup
highlighting inspiration)
============================================================================== ==============================================================================
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl: