vi or emacs for editing Python on Linux?

Bud Rogers budr at sirinet.net
Mon Dec 24 10:00:04 EST 2001


John W. Baxter wrote:

> In article <roy-523932.14201223122001 at news1.panix.com>, Roy Smith
> <roy at panix.com> wrote:
> 
>> About all the vi I really know is <esc>:q!<ret>
> 
> I don't even know that much...I have to grab a book and look it up
> every time I get stuck in vi in a file I don't want to damage. 

I have heard vi described as that editor that has two modes: one mode 
beeps at you and the other one corrupts your file.

> On the other hand, I've used Emacs since about 1994, essentially full
> time, and still know only about two dozen commands.  They do what I
> need.
> 
> I could probably have learned that much vi.

When I first started learning Linux I found both vi and emacs alien and 
difficult with weird keystroke commands that didn't make any sense to 
me.  I used pico or joe not because I liked them, but because they were 
slightly less weird.

Over time I learned enough of emacs to appreciate its power and 
extensibility.  When I discovered Xemacs and gnus I adopted them 
wholeheartedly.  I never learned more than a dozen or so of the 
seemingly infinite number of possible Ctl-Alt-Meta-Esc-whatever key 
chords, but enough to do the things I needed to do.  I learned a little 
bit of lisp, enough to do some special formatting and customize my sig 
in gnus.

A couple of years ago I went to work in a shop full of Digital Unix 
boxes and decided I needed to learn vi whether I wanted to or not.  I 
started messing around with the vi clones on my Linux box at home.  I 
quickly discovered a couple of things.  One, I can bring up vi, make a 
quickie edit to a config file and save it in less time than it takes 
for my xemacs to come up and load all its initialization files.  Two, 
the syntax highlighting in vim is an order of magnitude better than any 
other editor I have ever used, including [x]emacs.   These days vim 
tends to be my editor of choice.  I only know and use a fraction of its 
capabilities, enough to do the things I need to do.

Having said all that, here's MHO on the vi vs emacs debate.  I don't 
claim to be an expert on either.

Emacs, and by extension Xemacs, is like one of those craftsman's 
toolboxes that you see in the fine woodworking catalogs.  The box 
itself is something of a work of art.  Inside is an astonishing 
collection of tools all cleverly packed together in the smallest space 
possible. The box itself is very high density. It weighs about fifty 
pounds and takes both hands to carry.  It's an exciting adventure to 
unfold and unpack the box and discover all the neat things packed away 
inside.  Even a master craftsman will seldom use more than a few of the 
many tools available.  But if you take the time to learn them all you 
can make anything from a matchbox to a house. 

Vi, and especially its clones like elvis or vim, is like one of those 
swiss army knives that has 40 different blades and gadgets.  It will do 
almost anything you ever want to do once you learn what all the gadgets 
are and how to use them.  It will fit in your pocket although it makes 
pretty big bump and will likely set off the metal detector at the 
airport.  You will rarely if ever use the magnifying glass or the 
corkscrew in real life, but they are handy to have if you really need 
them.  And if you ever get stranded in the mountains you will be very 
glad it's in your pocket.

Both editors have a substantial learning curve.  It takes some time and 
effort just to get to the point where you can use them effectively, and 
more to get comfortable with either one.  Either editor has more power 
and capabilities than most users will ever use.  Which one is right for 
any particular user is a matter of taste and circumstance.  I would say 
for the typical sysadmin who makes lots of small quick edits vi is 
probably more efficient.  A developer who spends all day editing lots 
of source files might find the emacs environment more comfortable.   
Serious emacs users typically start emacs when they log in and leave it 
running til they quit for the day.  They may have dozens of files open 
at any given time and bounce back and forth between them.





More information about the Python-list mailing list