Don't be proud of an empty vimrc

published February 17th, 2012

In every vim-related thread on Hacker News, there seems to be at leat one guy bragging about how he works with an extremely minimal vimrc. This guy is pretty much always proud of himself, but he's wrong to be.

You shouldn't be proud of an empty vimrc. You should, instead, recognize what you're doing: wasting time.

A better vimrc will make you a faster programmer, and you should be lavishing it with the time and attention your primary tool deserves.

I've been vimming for five years now, and I've grown my vimrc with me. Today, my editor is highly-tuned for exactly the kind of work I do. It's optimized for the style of code I write, the way I like to split my windows, and even corrects my typos. Firing up vim for me is like slipping into a broken-in hiking boot that gets more comfortable with every mile.

Five years ago, I bound <Leader>w to C-w w (switch to next window). This mapping saves me hundreds (hundreds!) of keystrokes a day.

It took me four years to realize I should map :Q to :q so that vim would still quit when I typoed it. That one probably keeps my blood pressure 1% lower than it would be otherwise.

I could write code without my RunCurrentTest() function, but I wouldn't want to.

Do you have shortcuts all your common tasks that take more than two keystrokes? If not, is that because you enjoy typing? Wouldn't it be better to go map a Leader command to something right now?

Invest in your vimrc. It'll start paying you back right away and become immensely valuable over the years. I plan on passing mine on to my kids along with the rest of my estate.

Finally, if we're going to pour all this work into our vimrcs (and we should), shouldn't we make sure we have our customizations everywhere?

If you can't install all your dotfiles with a couple shell commands, you're working too hard. Create a git repo for your config files and write a quick script to symlink them appropriately. Now you can make any machine feel like home with two commands. Isn't that better?