How do I fuzzy-find and open any file in a project without using plugins?
Answer
:set path+=** | :find
Explanation
By adding ** to Vim's path option and using :find, you can search for any file recursively through your project tree with tab completion — no plugins required. This is a powerful built-in alternative to fuzzy finders like fzf for projects where you know part of the filename.
How it works
:set path+=**appends**to thepathoption, which tells Vim to search all subdirectories recursively when looking for files:find {partial-name}<Tab>searches across all directories onpathand offers tab completion on matches:set wildmenu(recommended) shows a visual menu of completions when you press<Tab>
Add these two lines to your vimrc to make it permanent:
set path+=**
set wildmenu
Example
With a project structure like:
src/
components/
Button.tsx
Modal.tsx
utils/
format.ts
From anywhere in the project, type:
:find But<Tab>
Vim completes to Button.tsx and opens it. If multiple matches exist, <Tab> cycles through them and wildmenu shows them in a menu.
You can also use glob patterns:
:find *.ts<Tab>
Tips
- Use
:sfindto open in a horizontal split, or:vert sfindfor a vertical split - Narrow results with a more specific path fragment:
:find utils/<Tab>limits matches to theutils/subtree - For very large projects, add
set wildignore+=**/node_modules/**,**/.git/**to skip irrelevant directories :findrespectssuffixesadd— set it to.js,.ts,.pyetc. to omit extensions when typing