Blazing Fast Fuzzy Find in Vim

Many people are surprised when they find out I use VIM as my primary editor. While vim seems like a ‘basic’ editor, it can have IDE like features added through its massive plugin community. I recently upgraded how I do fuzzy file navigation and find in project, and wanted to share how you can get blazing fast search in vim.

Fuzzy Find

First up is fzf . fzf is a general-purpose command-line fuzzy finder. It lets you fuzzy find over any input that is piped into it. If you don’t provide input, it uses find to search the current directory & subtree. Since I’m on macOS most of the time, I install fzf with brew install fzf. I then added the vim-fzf to my vim bundles. This plugin makes customizing fzf easier. I then updated my .vimrc with:

At this point, we’ve got pretty fast file navigation, but it includes icky files like .pyc files and the contents of .git. To fix this and get even more speed, we’ll use another tool.

The Silver Searcher

The Silver Searcher is another command like tool like grep or ack. Like ack it is optimized for searching code, and is orders of magnitude faster than ack due to being implemented in C. First, install the silver searcher with brew:

Recent Artwork

Links

Mark is a designer and web-developer, working with standards compliant HTML and CSS. He has been building websites since 2000. Currently he is employed at Freshbooks as a developer, and actively contributes to open source projects specifically CakePHP. He uses this site as a place to share what he has learned and made.