vi or emacs for editing Python on Linux?

Steve Lamb grey at despair.dmiyu.org
Fri Dec 21 21:36:36 EST 2001


On Fri, 21 Dec 2001 18:50:17 +2328, Fernando Pérez <fperez528 at yahoo.com> wrote:
> maxm wrote:
>> One of my biggest problems in switching is my editor. On windows I use
>> Ultraedit as a general editor, and i type really fast in it. Knowing the
>> shortcuts and all. Every time I boot up one of my Linux machines I have a
>> hard time editing files under the arcane unix editors. I have tried both
>> emacs and vim and I disklike both!
 
> I'm more of an Xemacs person than vi, but I'm not going to bash either here. 
> What I'm going to say is: when I started using linux, I already had some 
> fairly ingrained keyboard habits from windows, which I didn't want to lose. 
> So I spent some time customizing the keybindings for Xemacs (gvim didn't 
> exist at the time) to mimic a lot of what I knew from windows. The only 
> problem I now have is that even though I fly in Xemacs, I can't do anything 
> in a 'raw' emacs, I need *my* customizations :)
 
> So my point is: both are excellent tools, but go with a graphical one (either 
> Xemacs or gvim). And before you go too far, spend some time fixing the 
> keyboard shortcuts to everything you already know, it will save you *a lot* 
> of grief. If shift-arrow selection is second nature to you, look at the 
> latest Xemacs version which finally implements it.

    I know this is a large quote but the context is needed.  The problem with
this suggestion is, as you said, you need your bindings.  Now I'm not going to
pull the typical "learn vi since it is everywhere" schtick.  I found it bogus
when it was spit in my face and I most certainly will not fire it off against
anyone else.  No, what I want to do is tell my path on getting to vim.  What
is important is the path, not the final destination.

    First real text editor that I could remember was WordStar.  The real
WordStar, not a clone.  From there were 1-2 other oddball editors on a PC
clone.  Who knows what they were.  Then there was a string of editors that
used the WS keyset.  VDE(?) and QEdit being the last two.  There were also
also all the built in editors that come with different things.  Windows, OS/2
and console apps.  So the first 4-5 years or so I'd gone through about 8-9
different editors with the WS keyset being the preferred.

    Somewhere in there I also started using unix (Good ol' Netcom).  Started
off with pico (shush) and settled on joe since it has a WS-esque keyboard.
Stuck with joe for about a good 4-5 years.  I was frustrated with it at times
because it didn't do context highlighting.  This is something I found that I
liked from my Fido-Net days (GoldEd and GoldEd/2, mmmmm) and also found useful
now that I was doing more coding.  

    That began the search for a decent editor that would do context
hightlighting that uses the WS keyset.  None existed to my liking (I think to
this day none do).  BTW, through all this I was also using different
applications on Windows and OS/2 with proprietary editors.

    I tried JED for a while and attempted to wrap it in joe keybindings.
However the behavior of JED was different enough that I constantly got
confused.

    I tried emacs for all of 10 minutes.  This was because I figured that any
editor whose two default ways of accessing help were also the two sequences
commonly bound to BS/DEL clearly doesn't understand the concept.  Yeah, ^? and
^H seem intuative to the neophyte but dang is it annoying to have help come up
when I hit backspace.  I got the typical "Well, you can always rebind that."
True, but I expect an editor to have a bare minimum functionality from the
start and that just blew it.  I shouldn't have to learn how to configure the
editor just to use backspace.  Sorry, next.  'sides, I don't like the concept
of emacs as it is.

    That left... dundundunnnnnn.  vi.  Now, I spent a paragraph slamming emacs
so let me say that vi was worse than emacs in my mind.  Anyone doubts me just
go hit deja for my name in comp.editors and read my debates with people from
my joe-centric perspecitve.  Point is that vi was my last choice and if
anything else would have worked I would have used that instead.  In fact, vi
is still my last choice.  I use vim as my primary variant with nvi as my
stand-by and vi is dead freakin' last.

    Now, vi is completely different than the WS keyset is.  Even so once I sat
down with vim and ran through its tutorial I was able to do basic edits
without referring back to the tutorial or help all that often.  In about two
weeks I was as fast in vim as I was in joe.  More so since I was editing code
with context highlighting and that was helping me identify contextual mistakes
readily.  I don't think I was ever really unproductive, just had to get back
up to speed.  So it wasn't two weeks lost but rather some leasure time lost
since I couldn't do things as fast as I could.

    So here I am at the end of that journey and I'm currently using vim.  I'm
not recommending vim.  What I recommend is that the person pick an editor and
learn it.  It doesn't matter if it is emacs, vi, vim, elvis, nvi, jed, joe,
fte or any other that I'm sure I've looked at over the years.  pico, however,
is right out.  ;)  In my experience once an editor is picked it is fairly
trivial to relearn the keystrokes to go with the concepts.  More time is spent
learning how the editor behaviors differ than anything else.  For example in
joe marking is done by dropping a start and stop block marker.  One can adjust
either side by re-dropping the mark on either side.  vim, AFAIK, doesn't have
such a concept.  It has a different "Shift-select" style behavior but it is
not what joe does.  Learning how to intergrate how that function worked in my
editing style too longer than memorizing v|V|^V for the different methods of
visual selects.

    I can comfortably switch between WS, joe, CUA (Windows|OS/2), CUA variants
(like PMMail, TheBat!, basic editors built into other things, etc), vim, nvi
and with some difficulty, vi.  In fact on my desktop I switch between CUA and
vim on a regular basis since I dislike how kmail & knode call an external
editor.  So I am typing this message in vim and replying to email in CUA.

    Anyway, point is not to try to wrap one editor in another editor's
keystrokes.  You're spending more time rebinding everything and working around
how you think things should work than you would just learning the editor for
what it is.

-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
         ICQ: 5107343          | main connection to the switchboard of souls.
    To email: Don't despair!   |  -- Lenny Nero, Strange Days
-------------------------------+---------------------------------------------



More information about the Python-list mailing list