30 years ago (!) I was graduating from high school and had some idea that I’d be a professional guitarist (truthfully I had no idea what to do, guitar and writing were the only things I did reasonably well at the time) so I started taking lessons from a jazz cat named Richie Hart (ne’e Hohenburger) and preparing for the entrance exam at Berklee College of Music by learning theory, chords and scales I had no idea existed, as well as a few jazz standards such as ‘Round Midnight. I never did attend Berklee nor take the entrance exam, but I can pick up a guitar nearly 30 years later and (more or less) still play those jazz standards.
The vi editor is like that for me. As I’m working on/targeting multiple platforms now (OSX and *nix as well as Windows) I’m searching for an editor that will work in all situations. Choice of editor is like choosing a religion for geeks like me who sit in front of a computer for long hours, and not a decision to be taken lightly.
I hadn’t used vi since, like, 1989, but spurred on by the rather nice gvim and vim (‘vim’ is a more modern variant of the venerable vi) for Windows and Rob Conery’s vim kata posts, I found the muscle memory for vi was still there: The ‘katas’ or practiced motions/keystrokes/gestures of vi came back to me within ten minutes or so, to the point where I was starting to anticipate the tutorial steps.
The real beauty of (g)vim is that (a) it’s an incredibly efficient way to edit text once you get used to it, and (b) it lets you stay on the home keys which is a huge deal when you’re typing for hours on end. I hate reaching for the mouse as it disrupts my flow, and on a MacBook keyboard I find this even more of an issue (that’s muscle memory from Windows keyboards working against me now :)). Not to mention really powerful regular expression-based search and replace, a panoply of language-specific libraries and utilities, theming etc.
I’m not fluent in vi / vim yet (the cheat sheet is next to my monitor as I type) but I’m getting there. But once you work through “katas” and establish muscle memory for your new editor-of-choice… what then? What about other editing apps and their different keyboard shortcuts, esp in Windows? Thankfully there are some solutions for these as well:
- ViEmu brings vi / vim emulation to VS, Word, Outlook and SQL Server
- Vimium brings vi keyboard shortcuts to the browser
- I set up (g)vim as the default text editor under Windows
Vim is kind of exciting, like an old friend that has matured in new and interesting ways. I’ll keep doing the katas and see how it goes, but I think I’ve found my editor.