tags:

views:

124

answers:

4

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?

+3  A: 

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.

Vincent
+1  A: 

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.

Geoff Lanotte
+2  A: 

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.

Randy Morris
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
Bryan Ross
A: 

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.

Jabir Ali Ouassou