Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a quick way with macvim/NERDtree plugin to find a file?

Tags:

vim

macvim

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?

like image 539
randombits Avatar asked Jul 13 '10 21:07

randombits


People also ask

How do I show hidden files in NERDTree?

Press I ( Shift + i ) to toggle hidden files in the NERDTree explorer window. For more detail, access the NERDTree help file :help NERD_tree. txt and search for "hidden". And to hide hidden files by default, put let NERDTreeShowHidden=0 into your vimrc.


2 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.

like image 105
Randy Morris Avatar answered Nov 16 '22 01:11

Randy Morris


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.

like image 30
jabirali Avatar answered Nov 15 '22 23:11

jabirali