The vi Paradigm

by Krishna on June 3, 2009

While eating, I sometimes use Google Reader. While a book would do as well, each blog entry is only a few paragraphs long and you don’t have to quit in between. Google Reader handles the eating situation well because you can handle most of the actions using a single finger. “j” is Next, “m” is Toggle Read, “g” & “a” means Read All Items, “s” is Star (to read later) and so on.

Reader also has a feature to email a story you like to someone else. You press “e” and you get a few fields to type in the name of your friend and a note explaining what it is all about. Once you get those email fields, the keys I was talking about (‘j’, ‘m’, ‘g’, etc.) stop performing actions, so that you can use them to type email addresses and words. Once you send the email, those keys revert back to action keys.

I was reminded of the old Unix text editing program “vi” which has a similar way of operation. It has two modes called “Normal” and “Insert” modes. When you launch “vi”, unlike a text editor like Notepad, it does not allow you to start typing text. It launches in the “Normal” mode where all the keys have a special meaning. To start typing, you have to get yourself into “Insert” mode by pressing “i” (insert), “a” (append) or “r” (replace).

Once you are in Insert mode, you can keep typing until you are done. To get back to the Normal mode, you press ESC. Then in Normal mode, you can quit the program by pressing “ZZ” or some combination involving !q to save or cancel. Now, you might wonder why in the world would you want a Normal mode, when you are doing all your editing in the Insert mode?

Well, the thing is that the Normal mode has a host of very convenient editing functions. You can easily search and replace text. You can delete words and lines. If your job is copyediting, you will find yourself working most of the time in Normal mode. The downside is that you have to remember several different key combinations to be proficient in using “vi”. With the advent of modern text editors where you can perform many edit actions using mouse operations, the dual-mode behavior is less user-friendly, even though many Unix lovers still swear by it.

But in Google Reader, which is not a text editor, that behavior is very useful. You want to use the normal keys (instead of combining them with Alt, Ctrl or Shift) so that you can use a single finger for various actions. And when necessary, you can go into an editing mode for rare text-heavy operations. Nice!

{ 2 comments }

Peter Edstrom June 3, 2009 at 7:54 pm

long live VI !!

Krishna Kumar June 3, 2009 at 8:01 pm

Exactly, Peter. It is the program that will never die!

Comments on this entry are closed.

Previous post:

Next post: