Why vi?

You may have seen in the past week or so links to Beeswax, a new terminal-based productivity application inspired by Lotus Agenda. I’m not looking for a new productivity app—OmniFocus is working pretty well for me now—but I did find it interesting that Beeswax uses vi keybindings for adding and editing tasks.

Vi may be the oldest text editor still in wide use. The original vi was written by Bill Joy while he was a member of the BSD development group in the ’70s. It’s been rewritten several times since then; the most popular version nowadays is probably vim.

Text editing in vi is characterized by modes. Text is added to a file while in insert mode, where every keystroke results in a character appearing on the screen, just like the most familiar editors of today. Text is edited in command mode, where keystrokes do things to the text in the file. For example:

As you can see, vi commands can be combined and multiplied. Also, the command mode eliminates the need for Command- and Control-key combinations.

Modal editing may seem weird now, but it was the norm in the old days. In fact, vi was a big hit because it was a “screen editor,” allowing you to look at and work on an entire screenful of text at a time. Most editors back then were “line editors,” which restricted you to just one line at a time.

Vi is intriguing to productivity geeks because its ability to combine commands gives users the leverage to do a lot of editing with very little typing. Merlin Mann at 43 Folders has mentioned vi several times, both on the blog and on the MacBreak Weekly podcast. I’ve gone through my vi phases, too.

Back in my Linux days, I would periodically use vi as my primary text editor for a week or two at a time, but the modes always defeated me. I can’t tell you how many times I had to delete “:w” from my work1. I’m glad I spent the time to learn the basics, because vi can be very useful when I need to ssh into a remote computer and do a quick file edit. If the remote computer is Unix-like, some form of vi will certainly be there. But I was never able stay with vi as my regular text editor because of how I write.

As I see it, there are three types of writer:

First, there’s the kind that write final copy directly. Words, sentences, and paragraphs flow out in a smooth stream with no need for editing. While I don’t think any professional writing gets done this way, I know many people who can do correspondence like this. I’ve often gotten mail from clients with the notation at the bottom that the letter was “dictated but not reviewed.” Since these people don’t edit, the text editor they use is immaterial.

Second, there’s the kind that write in drafts. When I was a kid in the pre-PC era, school essays were always written as a longhand draft first, then edited and typed up as a final copy. Even today, when everyone writes on a computer, many writing guides suggest that you “get everything out” in a first draft and then clean things up with a good editing session. Vi’s modal editing can be great for this kind of writer. All of the first draft is done in insert mode and all the later editing in command mode.

Finally, there’s the kind that constantly fiddles with the text. This is me, and this is why my experiments with vi failed. I tend to rewrite sentences as I’m typing, stopping in the middle to go back and reset the tense or flip clauses around. It’s rare that I can type an entire paragraph without stopping to edit it. The need to keep shifting in vi from command to insert mode makes it a very clumsy editor for this type of writer.

I’ve tried to change my writing habits. I’ve tried to turn my brain’s internal editor off and just let the words come out, trusting myself to fix them later on. It would make writing much easier, regardless of the text editor I use. But I can’t do it.

One of the few advantages of reaching middle age is coming to recognize your strengths and weaknesses and knowing what you can change and what you can’t. This is something I can’t.

I wish the Beeswax developers well; I’m sure their system will be just the thing for many people. But I know my limitations.

Tags:


  1. That’s the command for saving.