Happy Birthday, Vim

So it’s Vim‘s twentieth birthday today.  Or yesterday, depending on where you stand vis-a-vis the international dateline.  (screenshot above is MacVim displaying a snippet of the current MMORPG Tycoon 2 codebase)

For those with other backgrounds, vim is a free text editor.  It’s basically an improved version of vi, the original visual text editor.  (vi was the first program which would display your text at the same time that you were editing it)  Another popular old text editor which is still in modern use is emacs.  And the flame wars between vi users and emacs users are one of those eternal debates amongst IT people who have nothing better to do with their time, right up there with tabs vs. spaces (tabs), tabstops (4), little-endian vs. big-endian (big), and Coke vs. Dr. Pepper (just some tea, please, and a little bit of milk would be lovely, thanks).

Functionally, vim is just a text editor.  But it’s a text editor that’s designed around being used exclusively by the keyboard;  once you really know what you’re doing, you never have to touch the mouse at all.  Or even move your fingers away from the home row.  (Don’t touch your arrow keys!)  Once you get used to it, it’s actually substantially faster and easier to get around a text file — or a whole project — this way.  But it does take a bit of practice and research to reach the point where it becomes effortless.

Oddly enough, my first experience with vim was with its first appearance anywhere;  on Fish Disk #591, for my Amiga 500 computer.  Admittedly, it completely baffled me at the time, and I quickly threw it aside to spend more attention on the various games which were (let’s be honest) the main reason I acquired and kept those disks of freeware software.  And it wasn’t until a decade later that I’d re-encounter vim, as I started to play with Linux, where it was one of several “vi-like” editors available (though it seemed to be gaining acceptance as the best of the lot).  I still didn’t use it much, but I at least learned enough to use it as my default Unix editor.  And during my time at Atari Melbourne House, I wrote a few server programs and a lot of perl scripts, all using vim as my source code editor.

But it wasn’t until very recently, when I started poking with Xcode 4, with its major revamp of Mac and iOS coding features, where I finally decided that I really wanted a more consistent interface for writing code, something that would work the same across multiple platforms, and would remain responsive and not inexplicably freeze up the way that most IDEs will occasionally do.  Other people talked about how great the Mac-exclusive text editor TextMate is, and I considered it, but I really wanted something that I could use on any platform.  So my mind went back to vim, and I really dove into all the details that I had only skimmed before.

I would estimate that it took me about two weeks of full-time development using vim to get back to my usual development speed.  And after another two weeks, I was substantially faster in vim than in other editors.  (Of course, I was already familiar with many of the core vim concepts;  others have estimated 1-2 months to become proficient, for someone who’s jumping in cold)

Anyhow.  I just wanted to mention.  Just because it’s made coding so much less painful, again.  Any coders out there, I’d definitely recommend experimenting with other text editors, and see if there’s one that works well for you personally.  Don’t just always use the one that’s built straight into your IDE by default, the way that most of us do.  There are far better tools available out there, if you’ll only look!