Learning Vim

Get Started

Recently I’ve been asked for advice on learning Vim.

If possible, I recommend pairing with an experienced Vim user.

Like learning a language by spending time with native speakers, you’ll pick up the ‘slang’ faster and get a feel for thinking in Vim.

If you don’t know a willing and competent Vim user, then read on for some advice and recommended resources.

Get it

If you’re a OSX user I recommend MacVim, which is actively developed, keeps up with the official version of Vim and has a “Mac look and feel”.

Vim is available on other platforms too.

Learn it

Clear your schedule for an hour, type vimtutor from your shell and walk through this canonical interactive tutorial that ships with Vim.

It’s the best way to get started.

Tip: Vim is either in Insert Mode, which lets you type text, or it’s in Normal Mode, in which you enter commands.

Always be aware of the current mode.

When in doubt, press ESC to get back to Normal Mode.

Use it

Vim has a steep learning curve and I don’t know any shortcuts for mastering it.

My advice is to use Vim in your real work every day.

Get Good

Once you’re familiar with opening and saving files, moving around a buffer (home-row keys only) and basic editing it’s time to move up a gear and get productive.

PeepCode Screencasts

The screencasts Smash Into Vim parts one and two are brilliantly produced, packed with information and great value (currently $9 each with a PeepCode subscription).

Watch them in order and follow along. They’re suitable for absolute beginners but more experienced users will probably pick up something useful, too.

Vimcasts

Vimcasts.org is the creation of Drew Neil.

This fantastic collection of screencasts covers a range of topics. If you’re wondering how to do something practical in Vim, it’s likely Drew has covered it. Browse through the back catalogue for ideas.

Vim Tweets

If you like your learning in bite sized pieces, then consider following @vimtips on Twitter.

The companion Vim Tweets website aggregates ‘official’ and user contributed tips.

Get Better

Now you’re moving around text files with ease and Vim has become your go-to editor.

You’ve made some tweaks to your configuration files and maybe automated common actions with macros and scripts.

It’s time to unlock more power and learn from the masters.

Gary Bernhardt

Gary Bernhardt of Destroy All Software fame is a true power user.

Check out his vimrc on Github and watch his Vim-heavy PeepCode screencast to see some turbo charged Vim usage.

Get Addicted

Once you get Vim into your muscle memory you’ll want to use it everywhere that text is edited.

Here are some plugins that imbue other programs with Vim.

Vimium

Use familiar Vim movement keys to control Google Chrome with Vimium.

Eclipse

The Eclim and Vrapper plugins are available to give Eclipse a little Vim.

Visual Studio

Firstly, my condolences that you’re forced to use Visual Studio.

Now go forth and install the ViEmu plugin for Visual Studio to make your editing a little less painful.