From 728e65c7e02706590852ae828454807b11f1ca1e Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 6 Mar 2026 11:15:54 -0500 Subject: [PATCH] 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. --- README.md | 14 ++++++++++++++ doc/diffs.nvim.txt | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 0051f21..85ac899 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,20 @@ vim.g.diffs = { 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 - **Incomplete syntax context**: Treesitter parses each diff hunk in isolation. diff --git a/doc/diffs.nvim.txt b/doc/diffs.nvim.txt index f0205d5..e1541e2 100644 --- a/doc/diffs.nvim.txt +++ b/doc/diffs.nvim.txt @@ -184,6 +184,12 @@ Configuration is done via `vim.g.diffs`. Set this before the plugin loads: 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) Controls which highlight features are enabled.