inicio mail me! sindicaci;ón

Emacs vs. VI

A ‘long, long, long while back’, the first real editor I used was Vi. After that, I used a great editor on VMS called Eve.

Then, just ‘a long while back’, I made the switch from bare-bones VI to Emacs. That was what all the cool kids were using (middle 90’s). Then I even moved to XEmacs, since it was the best of the bunch. After a while, though, I got tired of all the problems. I didn’t want to be an elisp programmer in order to debug the frequent problems. For example, to set up an advanced IDE mode seemed to require all these packages that never seemed to be the right version. These packages were huge. This meant that they were hard to understand or modify. Things would break and it was no longer fun. I also noticed that I was getting the emacs pinkie problem. Double no fun. Where is the performance boost that this environment was supposed to deliver?

At about that time, VIm became popular and life was good again. It had most of the features that I missed from Emacs (aka: the features I could get running). So, for a long time I kept VIm as my editor of choice on the command line. This era also had me using Eclipse briefly, Visual Studio with Visual Assist heavily, and a few brief moments with some attempts at IDEs for Python.

Now it is 2008 and I’ve heard the Yegge rants. I’ve decided to give Emacs another go. Besides, a practical programmer should always continue to learn. After going back to Emacs, I now use Emacs in VIPER mode for VI compatability. I use a mixture of the two systems, and it works pretty well. I’m kind of cheating. It isn’t so strange when you consider the fact, that I always preferred or had the emacs keyboard navigation shortcuts on any OS I use. (note:the old C-e, C-a are really from the DEC Tenex OS)

This recent switch has brought me to an interesting understanding. It is kind of like the ‘worse is better’ understanding that was a popular read many moons back.

Emacs, by default, is in a mode for text creation. Text manipulation and navigation require chorded keypresses and thus cost more.

VI, by default has 2 modes, and it is cheap to switch between those modes. Each of those modes reuses the same keys, but keeps the costs low for all three modes: (text creation, text manipulation and text navigation).

I think this is why VI is such a winner. If you are doing any programming, you spend as much time doing navigation and manipulation as you do creating text. The costs for these chorded key sequences start to pile up on that left hand pretty quickly. This last point is the greatest discovery for me so far. Why? It seems like a little forethought by the Emacs team could have spotted this and made the same change a while back. It will be hard to change now. (Just look at Steve Jobs… it is going to be d-i-f-f-i-c-u-l-t to get rid of that crappy menu bar at the top). (I wonder if there are a few other tools that I use, that could be looked at with the same analysis? Maybe some programming languages??)

So why use Emacs? Well, the architecture of that system is a lot better than the VI system. I can do some powerful text manipulation with that system via the elisp and macro system. I feel and know I can build real ’systems’ in elisp. I will say, though, that the cc-mode and other language mode support systems for emacs are really poor compared to the modern IDEs of today.

It is also interesting to point out where they both fail. Both systems are mired in the 1970s when it comes to UI. They are stuck in the old tty/terminal interface era. Neither system works or looks ‘just right’ on a modern operating system. This last point is easily seen as a big hole when you see the success of an editor like TextMate.

Keith said,

October 25, 2008 @ 1:42 pm

I just recently switched from Textmate to MacVim on the mac. Nice, native-ish interface that supports all the VIM commands as well as the native Mac (command-O, etc.). I too used Xemacs in the mid 90’s for a while, but the insanely long key commands (C-G C-X C-turnheadand_cough …) drove me nuts and gave me hand cramps. Why MacVim instead of Textmate, after 3 years of TM? TM is a great editor, but I work in several environments, and my brain needs one set of keystrokes to remember.

RSS feed for comments on this post

Leave a Comment