dmtrKovalenko/fff.nvim
FFF
AI agents (MCP) | Neovim users
A fast file search for your AI and neovim, with memory built-in
FFF stands for freakin fast fuzzy file finder (pick 3) and it is an opinionated fuzzy file picker for your AI agent and Neovim. Just for file search, but we do the file search really fff well.
FFF is a tool for grepping, fuzzy file matching, globbing, and multigrepping with a strong focus on performance and useful search results. For humans - provides an unbelievable typo-resistant experience, for AI agents - implements the fastest file search with additional free memory suggesting the best search results based on various factors like frecency, git status, file size, definition matches, and more.
MCP
FFF is an amazing way to reduce the time and tokens by giving your AI agent a bit of memory built-in to their file search tools. It makes your AI harness to find the code faster and spend less tokens by doing less roundtrips and reading less useless files.
You can install FFF as a dependency for your AI agent using a simple bash script:
|
|
The installation script is here ./install-mcp.sh if you want to review it before running.
It will print out the instructions on how to connect it to your Claude Code, Codex, OpenCode, etc. Once you have it connected just ask your agent to “use fff”.
Here is an example addition to CLAUDE.md that works perfectly:
|
|
Neovim guide
Here is some demo on the linux repository (100k files, 8GB) but you better fill it yourself and see the magic
https://github.com/user-attachments/assets/5d0e1ce9-642c-4c44-aa88-01b05bb86abb
Installation
FFF.nvim requires neovim 0.10.0 or higher
lazy.nvim
|
|
vim.pack
|
|
Configuration
FFF.nvim comes with sensible defaults. Here’s the complete configuration with all available options:
|
|
Key Features
Available Methods
|
|
just jump to the definition and see what other APIs are exposed we have a plenty
Commands
FFF.nvim provides several commands for interacting with the file picker:
:FFFScan- Manually trigger a rescan of files in the current directory:FFFRefreshGit- Manually refresh git status for all files:FFFClearCache [all|frecency|files]- Clear various caches:FFFHealth- Check FFF health status and dependencies:FFFDebug [on|off|toggle]- Toggle debug scores display:FFFOpenLog- Open the FFF log file in a new tab
Debug Mode
Toggle scoring information display:
- Press
F2while in the picker - Use
:FFFDebugcommand - Enable by default with
debug.show_scores = true
Multi-Select and Quickfix Integration
Select multiple files and send them to Neovim’s quickfix list (keymaps are configurable):
<Tab>- Toggle selection for the current file (shows thick border▊in signcolumn)<C-q>- Send selected files to quickfix list and close picker
Live Grep Search Modes
Live grep supports three search modes, cycled with <S-Tab>:
- Plain text (default) - The query is matched literally. Special regex characters like
.,*,(,),$have no special meaning. This is the safest mode for searching code containing regex metacharacters. - Regex - The query is interpreted as a regular expression. Supports character classes (
[a-z]), quantifiers (+,*,{n}), alternation (foo|bar), anchors (^,$), word boundaries (\b), and more. - Fuzzy - The query is fuzzy matched using Smith-Waterman scoring. Accommodates typos and scattered characters (e.g., “mtxlk” matches “mutex_lock”). Results are filtered by a quality threshold to avoid overly fuzzy matches.
The current mode is shown on the right side of the input field (e.g., plain, regex, fuzzy) with color-coded highlighting.
You can customize which modes are available and their cycling order globally in your configuration, or per-call when invoking live_grep().
Global configuration:
|
|
Per-call configuration:
|
|
When only one mode is configured, the mode indicator is hidden completely and the cycle keybind does nothing.
Constraints
There are a number of constraints you can use to refine your search in both grep and file search mode:
git:modified- show only modified files (one ofmodified,staged,deleted,renamed,untracked,ignored)test/- any deeply nested children of any test/ dir!something- exclude results matching something!test/,!git:modified- combining with any other constraint works as negation./**/*.{rs,lua}- any valid glob expression via the fastest globbing library
For grep only:
*.md,*.{c,h}- extension filteringsrc/main.rs- grep in a single file
In addition to that, all constraints can be combined together like:
|
|
This will find all the files that qualify the constraints and:
- match both user and controller (for file mode)
- match “user controller” (for grep mode)
Cross-Mode Suggestions
When a search returns no results, FFF automatically queries the opposite search mode and displays the results as suggestions:
- File search with no matches → shows suggested content matches (grep results) for the same query
- Grep search with no matches → shows suggested file name matches for the same query
Suggestions are clearly labeled with a “No results found. Suggested …” banner (highlighted with hl.suggestion_header). You can navigate and select suggestion items just like normal results — selecting a grep suggestion will open the file at the matching line.
Git Status Highlighting
FFF integrates with git to show file status through sign column indicators (enabled by default) and optional filename text coloring.
Sign Column Indicators (enabled by default) - Border characters shown in the sign column:
|
|
Text Highlights (opt-in) - Apply colors to filenames based on git status:
To enable git status text coloring, set git.status_text_color = true:
|
|
The plugin provides sensible default highlight groups that link to common git highlight groups (e.g., GitSignsAdd, GitSignsChange). You can override these with your own custom highlight groups to match your colorscheme.
Example - Custom Bright Colors for Text:
|
|
File Filtering
FFF.nvim respects .gitignore patterns automatically. To filter files from the picker without modifying .gitignore, create a .ignore file in your project root:
|
|
Run :FFFScan to force a rescan if needed.
Troubleshooting
Health Check
Run :FFFHealth to check the status of FFF.nvim and its dependencies. This will verify:
- File picker initialization status
- Optional dependencies (git, image preview tools)
- Database connectivity
Viewing Logs
If you encounter issues, check the log file:
|
|
Or manually open the log file at ~/.local/state/nvim/log/fff.log (default location).