blink-cmp-fuzzy-path
A Neovim plugin that provides fuzzy file path completion for blink.cmp. Type @ in configured filetypes to get intelligent file path suggestions. This plugin is basically created for usage with Claude Code or OpenCode.
NOTE: this is complete rewrite and simplification of original blink-cmp-fuzzy-path. This version relies solely on fd and on blink.cmp native fuzzy search. As well almost all configuration options are removed.
Features
- π― Fuzzy path completion - Type
@to get all files and folders, blink.cmp handles fuzzy matching - π Files and folders - All files and directories included in search results
- π Filetype-specific - Only activates in configured filetypes (default: markdown, json) -β¦
blink-cmp-fuzzy-path
A Neovim plugin that provides fuzzy file path completion for blink.cmp. Type @ in configured filetypes to get intelligent file path suggestions. This plugin is basically created for usage with Claude Code or OpenCode.
NOTE: this is complete rewrite and simplification of original blink-cmp-fuzzy-path. This version relies solely on fd and on blink.cmp native fuzzy search. As well almost all configuration options are removed.
Features
- π― Fuzzy path completion - Type
@to get all files and folders, blink.cmp handles fuzzy matching - π Files and folders - All files and directories included in search results
- π Filetype-specific - Only activates in configured filetypes (default: markdown, json)
- π Fast search - Uses
fdfor blazing-fast path discovery with caching
Requirements
-
Neovim β₯ 0.9.0
-
blink.cmp - The completion framework
-
fd - Fast file finder
Installation
Using lazy.nvim
Production (from GitHub):
{
'saghen/blink.cmp',
version = '*',
dependencies = {
'daliusd/blink-cmp-fuzzy-path',
},
opts = {
sources = {
default = { 'fuzzy-path', 'lsp', 'path', 'snippets', 'buffer' },
providers = {
['fuzzy-path'] = {
name = 'Fuzzy Path',
module = 'blink-cmp-fuzzy-path',
score_offset = 0,
opts = {
filetypes = { 'markdown', 'json' }, -- optional
},
},
},
},
},
}
Configuration
The plugin uses fd with its default settings:
- Respects
.gitignorefiles - Excludes hidden files (dotfiles)
- Returns both files and folders
- Searches from current working directory
Usage
- Open a file in a configured filetype (e.g.,
markdown) - Type
@to trigger completion - Type your fuzzy query (e.g.,
prvdwill matchprovider) - blink.cmp will fuzzy filter all files and show matching results
- Select a path to insert it
Example
In a markdown file:
See @read
Typing @read will show fuzzy-matched suggestions including both files and folders:
src/readers/README.mddocs/readme.mdsrc/readers/file_reader.lua
Folders are displayed with a trailing / for easy identification.
How It Works
- Trigger Detection: When you type the trigger character (
@by default), the plugin activates - File/Folder Search: Uses
fdto find all files and folders in your project (cached for 30 seconds) - Fuzzy Filtering: blink.cmp applies fuzzy matching to filter results based on your query
- Completion: Shows results in the blink.cmp completion menu with appropriate icons (files vs folders)
Troubleshooting
No completions appearing
- Check filetype: Make sure your current bufferβs filetype is in the configured
filetypeslist - Check trigger: Ensure youβre typing the correct trigger character (default:
@) - Check fd: Verify that
fdis installed and available in your PATH:
which fd
Slow performance
- Results are cached for 30 seconds, so the first search may be slower
- If your project has millions of files,
fdmay take time to list them all fdrespects.gitignoreby default, which helps with performance
Development
Project Structure
blink-cmp-fuzzy-path/
βββ lua/
β βββ blink-cmp-fuzzy-path/
β βββ init.lua # Main module & blink.cmp source
β βββ config.lua # Configuration management
β βββ path_search.lua # Path search logic
βββ README.md
βββ LICENSE
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Acknowledgments
- blink.cmp - The completion framework with fuzzy matching
- fd - Fast file finder
- original blink-cmp-fuzzy-path - original plugin