Experimenting with Vim

by Matt Montaruli on September 13, 2012

Vim is often regarded as a productivity powerhouse for coders when it comes to text editors. Don’t believe me? This article and this article are great reads on the subject.

Anything that is purported to increase ones productivity will peak my interest, so naturally I was anxious to learn more about Vim right away.

The catch with Vim is that there is a steep learning curve. It’s not so easy to make a switch from TextMate or Sublime Text 2 over to Vim. However, I still had to experiment with Vim, and I must say, I have fallen in love.

Below are some of my experiences in getting my feet wet while experimenting with Vim.

How I Got Started

I developed a strong interest in Vim when installing Vimium for Chrome. Vimium is a Chrome plugin allowing you to move around a web page using the same keystrokes you would in Vim. This helped to get a quick feel for Vim keyboard shortcuts and moving around a file without using the mouse or arrow keys.

After about a week of using Vimium, I decided to dabble in Vim by using Vim Tutor to learn the more advanced keyboard shortcuts from the command line.

Shortly after, I experimented with Vim for about a week while learning BDD with Cucumber and RSpec. I read through the first part of The RSpec Book and decided to complete the entire book tutorial from the command-line only.

I used the usual commands such as mkdir, touch and cd to set up the file structure for the tutorial and then started editing all the tutorial files in Vim. While moving through the book’s tutorials, I saved some Vim cheat sheets, which helped to build the habit of using Vim commands. As these shortcuts got more and more ingrained in my muscle memory, I began to learn new shortcuts.

How Other Text Editors Feel Now

When going back to Sublime Text 2, I have found that moving around a text file feels slower, as if there is a disconnect between my mind, the keyboard and the text file. It really disrupts your flow when you have to stop and grab the mouse or trackpad.

While there are some pretty advanced features in modern text editors such as ST2, I haven’t even scratched the surface of what Vim can do. I’d imagine there are plenty of plug-ins for Vim that can handle some of these advanced features, and I’d bet there is a whole bunch of additional functionality in Vim where I wouldn’t even remotely miss some of the perks of ST2.

A sticking point with Vim is that since there is so much to know, you need to keep using it to reinforce what you learn. If you allow some time to pass without using this text editor and complete some work in ST2 or TM, you’ll forget a lot of those useful Vim shortcuts that you were just starting to learn.

Have any Vim experiences you’d like to share? Let us know in the comments below.