What's the fastest way to find and open a file with MacVim? NERDtree is a great plugin, but I still have to navigate (sometimes very deep) directory trees in order to get to the file I want to get to. Is there any functionality that allows me to search a substring of a file name and show me a result set I can click on from that?
7 Answers
Since we are all listing alternatives here, Command-T is another fuzzyfinder-esque plugin that attempts to mimic textmate's find function.
Docs can be found here.

- 39,631
- 8
- 69
- 76
-
I've been using Command-T for a couple months in MacVim, and swear by it! Although, I'm willing to give fuzzyfinder a shot – rossipedia Jul 14 '10 at 14:52
You should also check out the builtin command :find
.
First, you need to define what directories to search. If you wish to recursively add the subdirectories of /path/to/project to your search path, use:
:set path=/path/to/project/**
You can then open e.g. /path/to/project/then/some/random/subdirectory/filename.ext by issuing:
:find filename.ext
To open your search result in a new tab or split-screen, try :tabfind
or :sfind
instead.
Edit
I just noticed that you're looking for fuzzy matching of files, in which case I don't believe :find
is up to the task. You may be interested in the :Find
function defined in this vimtip though.

- 1,315
- 7
- 13
-
This was extremely helpful, didn't know it supported find! Awesome, my life is so much easier now. Have an upvote – Matthew Stopa Sep 08 '11 at 17:51
I use fuzzyfinder.vim for almost two years and love it a lot.
It supports to find file in fuzzy way, for example to find foobar.rb file, you can just input 'fb' to get foobar.rb matched, for file navigation, you can add "**/" in front of file's name to find a file in any levels deep. It provide more modes to find dir, recent open file, recent vim command, tags etc fuzzily, you can even define your own mode.
If you like TextMate's way, you can read this post for more details.

- 901
- 7
- 8
I used fuzzyfinder for a long time before finding ctrp (https://github.com/kien/ctrlp.vim) You could make a custom finding command that works on linux and window. There are some posible settings of ctrlp - Skip file types or directory - Ignore version control system files (ex: .git, hg,..) - Use external command for making file list (ex: 'find' command in linux) - Cache filelist ...
It is not related to NERDtree plugin that you were talking, but I think you should take a look...

- 709
- 6
- 7
Along the same lines as fuzzyfinder is PeepOpen. I have been using it for a few months and prefer it over fuzzyfinder now. It is strictly mac, and requires Snow Leopard.

- 7,490
- 1
- 38
- 50
I'm using Vim-Plug to manage Vim plugins, there is an awesome fuzzy finder plugin that name is fzf.vim
which it is based on fzf. If you use Vim-Plug you can install it as easy as below commands inside .vimrc
file:
Plug 'junegunn/fzf', { 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
Then exit Vim and re-open it and write:
:PlugInstall
After true installation you can have any search, documents are here.

- 29,059
- 15
- 130
- 154
-
2This is the best fuzzy finder solution for Vim as of 2020. Command-T, Ctrlp, FuzzyFind and others are all good solutions that may still work well for many use cases but fzf is the best modern option. – mthorley Dec 01 '21 at 16:32
I've added the following Nerdtree plugin which integrates grep as one of the options in the Nerdtree menu:
https://gist.github.com/masaakif/414375
Seems to work pretty well, it's equivalent to "grep -r" and you can even select the result and edit the file shown.

- 3,388
- 1
- 25
- 28
-
1When browsing the tree in NERDTree, I position the cursor on the (sub)directory I want search and then just hit "m" for the NERDTree menu, then the menu pops up and the last option is (g)rep directory, so you hit "g" to search. Same rules apply for quoting text with e.g. spaces and special characters as in grep. BTW the folks at Square have put their favourite Vim setup into a repo called [Maximum Awesomeness](http://corner.squareup.com/2013/08/fly-vim-first-class.html) which includes the plugin. – Sam Critchley Sep 30 '13 at 20:49