There’s a (Vim Plugin) for That! Part I: Fuzzy Finder

Posted on by in Process

One of the most popular features of TextMate and RubyMine is Command-T, the ability to jump to a file with just a couple of keystrokes. Vim lacks this feature out of the box, leaving Vim newcomers less efficient.

For the casual Vim users out there, when in doubt, remember this: there is a plugin for that!

FuzzyFinder

Partially enter the thing of interest, i.e., class name, method name, or file name, FuzzyFinder will take you there. Its three most useful features are:

  • When you know where you want to go, type in a couple letters, FuzzyFinder will autocomplete or “fuzzy match” the object in question.
  • When you don’t know where you want to go, FuzzyFinder can be used as a file explorer.
  • When you want to jump into currently opened files, FuzzyFinder can be used as a buffer explorer

Setup

After installing FuzzyFinder, add the following lines to your .vimrc:

nmap ,f :FufFileWithCurrentBufferDir<CR>
nmap ,b :FufBuffer<CR>
nmap ,t :FufTaggedFile<CR>

Then, generate the tag file:

 ctags -R --extra=+f .

Usage

One Plugin to Rule Them All

Other Vim plugins, such as NERDTree and Command-T, are great in their own rights; but FuzzyFinder offers the combined features of both plugins with a better UI and workflow.


Feedback

  Comments: 7


  1. Sweet Vim tip Rit.

    Command-t in TextMate and RubyMine are some real time saves. With FuzzyFinder you can have the same in Vim. No need to use those kludgy editors. Vim FTW!


  2. I really missed RubyMine’s search for and open a Ruby class (Command + n or ⌥N) command and similar search for and open file command (Command + shift + n, ⌥⇧N). With fuzzy search and ctags, I now have a reasonable replacement in vim. Thanks!


  3. I highly recommend PeepOpen for this.

    http://peepcode.com/products/peepopen


  4. There is also Command-T plugin for vim, but it requires you to do a little bit of work in creating a C extension for Ruby http://www.vim.org/scripts/script.php?script_id=3025


    • To be clear, that’s compile a C extension, not create one. Basically it means you run rake make after downloading it :-)

      I find it superior to FuzzyFinder, and though PeepOpen is sexy, it is not cross-platform nor console Vim-friendly.


  5. Seem to have a dependency on another utility plugin “l9″…

Your feedback