After a brief affair with another editor, I’m now back
my beloved Vim again. What’s more, I decided to invest the time I should have put in years ago when I started using
it, and learned to do things more efficiently. Besides reading
Practical Vim and watching some
VimCasts, I went through my list of plugins I collected over the years, removed the
ones I wasn’t using, learned about a couple of new ones I didn’t know, and re-learned some of the ones
I forgot about. Here’s the list of my favorite plugins I ended up with.
Easy management of Vim plugins. I put all my Vim settings in a Git
repository, and this plugin allows me to add plugins as a Git submodule
somewhere in my settings tree. For an extensive tutorial, have a look at the
Several other plugin managers (such as
Vundle) have emerged since I started
pathogen, but I haven’t tried them since this one does the trick for
Have sensible, safe defaults for a modern day Vim setup. Allows me
to trim down my vimrc a bit.
ctrlp: Open files anywhere below your
current directory very quickly, using
fuzzy search. This is similar to Sublime’s “Go to anything” (which even uses the same
shortcut). I almost exclusively open files using
unimpaired: Easy to remember extra
[ shortcuts for a handful of useful tasks:
cycling through files, buffers, arguments, SCM conflict markers, spelling errors; exchange
lines, switch options, insert empty lines, … Also comes with shortcuts to
toggle options, such as
col (toggle invisible characters),
(toggle number column),
cos (toggle spell correction), …
detectindent: Automatically detects whether tabs are expanded or not. Handy
for working on multiple codebases with different tab preferences.
a: Switch between corresponding
.(c|cpp|mm) headers easily
ack: Lightning fast greps across a project. I actually use
ag as backend.
clang_complete: C/C++ code completion that works. Requires
clang to be on your system (which it is by default on MacOS X)
endwise: Automatically adds
you write a
begin, but does it conservatively so it never inserts anything unwanted.
fugitive. An extremely powerful Git integration for
Vim. Apart from providing an interface for doing all kinds of (interactive) Git tasks from within Vim, also
provides a status line entry for showing your current branch etc.
about how to use this plugin.
abolish: A set of search/replace/conversion commands
that support plurals, case (MixedCase, camelCase, snake_case, …), … Can be used to rename variables
easily, change case of avariable, … There are also
about this plugin.
gundo: Graphical overview of Vim’s undo tree.
If you undid a couple of changes,
did some other stuff, and decided that your initial version was actually better,
you can easily revert back. This has saved me and my undecisive mind a couple
of times already. Also has a VimCast.
matchit: Match more than just braces with
%. Cycles through if/else, matches
HTML/XML tags, …
surround: change/delete/add surrounding quotes, parentheses, tags, …
syntastic: Checks the syntax of your current file on save, and displays
errors using markers in the sidebar. Saves you a round trip to your terminal
when trying to compile/run the file.
tagbar: A navigation
window with an overview of all functions/variables in
your current file. Uses
ctags behind the screens, but doesn’t require you
ctags yourself on the codebase. It can also put an entry with the
current function in your status bar (which is useful when editing files
with large functions). This is similar to the
taglist plugin, except that it takes into account scopes,
For Markdown, I use the markdown2ctags script to generate tags.
tcomment: Quickly comment out lines and code blocks. I used
NERDCommenter for a
tcomment came with more natural Vim shortcuts (and is also supported
by Vrapper). I also tried
commentary (mostly because it’s by Tim Pope, and
because it supports
repeat), which uses the same shortcuts, but this one doesn’t
comment indented code blocks the way I want it to (i.e. put the indentation after
the comment string instead of in front).
Makes it easy to jump to any word in your buffer, by assigning
a single letter to each word, highlighting it, and drilling down with each keystroke.
Although this plugin is probably
as fast and intuitive as it gets, in a GUI mode, it may be a tad faster to
simply reach for the mouse and click in the document. However, when editing
remote files without mouse support, this plugin is great!
snipmate: An engine for
inserting snippets of code. There’s also a
standard repository of standard snippets, but I
mostly only use my own snippets for larger snippets
(e.g. create a new class, insert copyright headers, …).
Downsides: it no longer works with
clang_complete (although it used to), and
it seems hard to override already existing snippets (which is why I don’t
use the default repository).
mru: Easily access recently opened
files through the MRU list.
Asynchronous version of
:make, so you can still edit your code while your project is
building. The downside is that it requires iTerm on MacOS X or fires off a separate command
shell on Linux and Windows, so it’s still not as nice as a native window running a build in
its own thread, but it gets the job done.
NERDtree: A better file system explorer than the default one. I don’t really use it
that often (since I use
ctrlp to open files), but it’s handy for when you need
to look around your project tree.
.’ support for some of the plugins I use.
speeddating: Increment dates using
Ctrl-X. Not that I often do this,
but since it just adds extra support to
Ctrl-X, I just load it.
exchange: Exchange pieces of text
argtextobj Adds a
a for deleting/changing/selecting a function argument.
the paragraph motion behavior for lines with only whitespace.
molokai: A beautiful dark gray
based on the Monokai scheme from TextMate, and popular in other modern editors as well.
- Vrapper: Not really a Vim plugin, but worth the mention: this Eclipse plugin
provides a wide variety of Vim bindings to use inside Eclipse, so you can stay efficient when working on