docs: document picker integration via extra_filetypes

Problem: `extra_filetypes = { 'diff' }` enables highlighting in
telescope, snacks, and fzf-lua git preview buffers, but this was
not documented beyond a brief mention of `.diff` files.

Solution: add a README FAQ entry and expand the vimdoc
`extra_filetypes` field description to mention specific pickers
and which previewer styles are supported.
This commit is contained in:
Barrett Ruth 2026-03-06 11:15:54 -05:00
parent b2fb49d48b
commit 728e65c7e0
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
2 changed files with 20 additions and 0 deletions

View file

@ -73,6 +73,20 @@ vim.g.diffs = {
See the documentation for more information. See the documentation for more information.
**Q: How do I enable highlighting in telescope/snacks/fzf-lua git previews?**
Add `'diff'` to `extra_filetypes`:
```lua
vim.g.diffs = {
extra_filetypes = { 'diff' },
}
```
Works with telescope.nvim (`git_commits`, `git_bcommits`, `git_status`),
snacks.nvim (`style = "syntax"` only), and fzf-lua (builtin previewer only).
Terminal-based previewers are not supported.
## Known Limitations ## Known Limitations
- **Incomplete syntax context**: Treesitter parses each diff hunk in isolation. - **Incomplete syntax context**: Treesitter parses each diff hunk in isolation.

View file

@ -184,6 +184,12 @@ Configuration is done via `vim.g.diffs`. Set this before the plugin loads:
extra_filetypes = { 'diff' }, extra_filetypes = { 'diff' },
} }
< <
Adding `'diff'` also enables highlighting in
picker preview buffers that set `filetype=diff`:
telescope.nvim (git_commits, git_bcommits,
git_status), snacks.nvim (syntax style only),
and fzf-lua (builtin previewer only). Terminal-
based previewers are not supported.
{highlights} (table, default: see below) {highlights} (table, default: see below)
Controls which highlight features are enabled. Controls which highlight features are enabled.