Live tgrep search in Neovim, rendered by the fff-plus.nvim picker.
picker query
│
▼
debounce and cancel stale work
│
▼
tgrep --json ──► running server / local index / filesystem fallback
│
▼
decode matches ──► fff-plus picker ──► file, split, tab, quickfix
Running :Tgrep :Tgrep in Kitty searches this repository's README, tests, and
help documentation.
- Neovim 0.10 or newer
- tgrep on
PATH - fff.nvim
- fff-plus.nvim
For indexed, continuously updated searches, start a server in the project:
tgrep serve .The plugin still works without a server. The tgrep CLI uses an on-disk index when available and otherwise falls back to scanning the filesystem.
{
'vinitkumar/tgrep.nvim',
dependencies = {
{
'dmtrKovalenko/fff',
build = function()
require('fff.download').download_or_build_binary()
end,
},
'vinitkumar/fff-plus.nvim',
},
cmd = 'Tgrep',
opts = {},
keys = {
{
'<leader>tg',
function()
require('tgrep').live_grep()
end,
desc = 'Tgrep project',
},
{
'<leader>tw',
function()
require('tgrep').live_grep({ query = vim.fn.expand('<cword>') })
end,
desc = 'Tgrep word',
},
},
}:Tgrep
:Tgrep function_name
:Tgrep! TODO|FIXME:Tgrep! uses the fullscreen fff-plus layout. Searches begin after three
characters by default because tgrep's index is trigram-based. Each new query
cancels pending or active work before starting another search.
The picker inherits fff-plus controls, including:
| Key | Action |
|---|---|
<CR> |
Open match |
<C-s> |
Open in split |
<C-v> |
Open in vertical split |
<C-t> |
Open in tab |
<C-p> / <C-n> |
Move up / down |
<C-q> |
Send match to quickfix |
<C-g>q |
Send match to location list |
<C-/> |
Toggle preview |
<F1> |
Show picker help |
require('tgrep').setup({
binary = 'tgrep',
debounce_ms = 80,
min_chars = 3,
smart_case = true,
root_markers = { '.git' },
args = {
'--hidden',
'--glob',
'!vendor/**',
},
picker = {
preview = { enabled = true },
layout = {
preview_position = 'right',
preview_size = 0.5,
},
},
})Per-call options override picker defaults:
require('tgrep').live_grep({
cwd = '/path/to/project',
query = 'SearchPattern',
fullscreen = true,
})Run :checkhealth tgrep to verify the executable and both picker dependencies.
make test
make lint
make format-checkThe integration test additionally requires real fff.nvim and fff-plus.nvim checkouts plus an installed tgrep executable:
make test-integration \
FFF_PATH=/path/to/fff \
FFF_PLUS_PATH=/path/to/fff-plus.nvimtgrep.nvim integrates Microsoft's tgrep and renders its results with fff.nvim through fff-plus.nvim. It is an independent community plugin and is not affiliated with Microsoft.
MIT
