Photo by Anthony Duran on Unsplash

New Tricks: Switching From Vim to SublimeText 2


When I first started developing software for a living, I was happy to edit my source with whatever editor was bundled into the IDE that I was using at the time (I’m remembering now that Turbo C++ 1.0 actually supported WordStar key bindings, and that I knew those bindings because I used WordStar to write my master’s thesis.  It also came with a box full of printed manuals that would break your toes if you dropped it on them). In the mid-90s I moved over to primarily working with Microsoft’s Visual Studio and invested too much time developing useful macros that were rendered useless every time a major release of MSVC came out and the newest batch of folks assigned to that team decided it would be cool and fun to rewrite the scripting architecture.

Eventually, a colleague pulled me aside and asked me why I wasn’t using a real editor. After my sputters of protest died down, he asked me to think about all the programmers I knew who I really thought were outstanding. What one thing did they all have in common — every one of them was a devoted user of either vi/vim or Emacs. He told me that I owed it to myself to download and install vim, print out a copy of a cheat sheet that he had created, and give it a month. I also got the O’Reilly book on vi and made myself pick up a new command every day or two. At the end of that month, all the initial discomfort of vi’s very weird way of looking at the world had converted over to comfort at the very logical and reasonable way that vi looks at the world.

Recently, more than a few developers here at Art & Logic have been talking about switching over to using SublimeText 2 as their primary editor; most of them had been devoted TextMate users. I had installed ST2 a while back and kicked its tires, but didn’t really see the attraction, or anything that stood out enough for me to consider switching over.

A few weeks ago, I stopped and had that same moment of reflection that I had been prodded into before: clearly these really talented developers were seeing something that I wasn’t, and the only way I’d be able to get a taste of that would be to switch over completely for a month and re-evaluate.

What I did:

  1. I enabled vintage mode. Vintage mode lets you use many of the vi-style editing commands that I’ve burned into muscle memory at this point. It’s not complete, and doesn’t support any of the “ex” commands that underlie vi. Okay, I can live without those.
  2. I watched a series of video tutorials offered by tutsplus. These went into a better level of detail to show me some of the things that I wasn’t seeing on my brief tire-kicking expeditions.
  3. Stopped using vim. This may be the most difficult, because when I’m at a command line, the command from my brain saying “edit foo.txt” comes out my fingers as “vim foo.txt”. (A more clever man than I would tweak some aliases and prevent this from being an issue).

Things were going really well for me, other than occasionally running into that problem where I’d try to execute one of the "ex" commands and come to a dead stop. Then I stumbled on a new ST2 plug-in that adds those commands: VintageEx.

One of the nice things about SublimeText 2 is that while it’s commercial software, you can use it for free without any features being disabled, and without there being a time limit. Every so often, a nag dialog pops up to remind you that you’re not using a registered copy and asking you to cough up the $59 for a license (a very generous license, as it’s per user, not per computer, so I can have it installed on my MacBook and also on our family machine, and run it inside the Windows XP and Windows 7 VMs that I use for development in those environments. Every time the nag dialog popped up, I’d close it immediately and mutter something about not paying a penny for software that I wasn’t really going to commit to.

It’s been over a month now, and I’ve settled in enough and am used to the very useful plugins that I’ve been using (if I did more web development than I do, the Emmet plugin (formerly ‘Zen Coding") alone would be worth the price.

I just paid for my license.

+ more

Accurate Timing

Accurate Timing

In many tasks we need to do something at given intervals of time. The most obvious ways may not give you the best results. Time? Meh. The most basic tasks that don't have what you might call CPU-scale time requirements can be handled with the usual language and...

read more