vi or emacs for editing Python on Linux?

Tim Hammerquist tim at vegeta.ath.cx
Fri Dec 21 17:53:11 EST 2001


maxm <maxm at mxm.dk> graced us by uttering:
> I am a long-time Windows developer who is trying to migrate to Linux for
> several reasons. But this doesn't come naturally to me :-) And some of the
> things about Linux I really like, others are a pain. Likewise with windows.
> But all in all I want to gradually switch.

Excellent. Best of luck!

> 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 guess it's because I have strong habbits by now, and not because the
> editors are bad.

Historically, I believe Emacs has been closer to the Win32 mindset as far
as user interface, but Vim  (the best vi clone, IMHO) has recently
included an "evim" command, loading vim with a point-and-type interface,
but with all of vim's power underneath. Vim's GUI version, gvim, also
has the classic pulldown menus available.

Both Emacs and vi have rather long learning curves, but they are both
among the most widespread, powerful, extensible, just plain groovy
editors around. They both also have numerous ports on Win32 platforms.

> But my point is that I figure that I have to use either editor if I want to
> switch platform. So before I commit myself to spending the days learning one
> of them thorougly (and swallow the loss in income ;-) ) I would like to know
> the strong/weak point in using either for Python.

I don't understand how you would lose income in learning to use free
software with ample documentation. Time, yes, but not money.

In any case, you don't _have_ to use either one. There are dozens of
powerful text/code editors available for unix/linux (and I've had good
results running Win32's UltraEdit-32 under WINE, a Windows emulator, in
case you're interested).


> I know this is close to religion. But are there any rational reasons to use
> one instead of the other for Python?

Emacs seems at times to be better supported in the Python community, but
there is a strong Vim undercurrent as well; neither of these are
noticeably dominant.  It definitely seems to me, however, that a vast
majority of linux pythonistas use _either_ vi or Emacs, or at least
don't talk about it much. =)

> My understanding is that for emacs I have to use a lisp dialect to
> automate/extend it, and in vim I can use Python as an extension language of
> sort. Do I understand that correctly?

Emacs' innate language is Emacs-lisp (elisp), yes. But there are new
extensions available, IIRC, that allow you to extend it in other
ways/languages. Pymacs is one.

Vim is very much extensible using Python, and I've just finished
rebuilding Vim with the latest Python 2.2 embedded.  In fact, Vim's
designed to compile with support for several languages, including
Python, Perl, Ruby, and others.

> I would especially like to use my next editor on my notebook with as little
> use of the mouse as possible.

Either Emacs or Vim are ideal for this, as they were designed to be
powerful before mice were standard computer equipment.

Go to http://www.python.org/editors/ and look at the tables there.
They list editors, IDEs, and other tools for multiple platforms that
support Python.  The list includes at least 10 linux editors that are
neither Emacs- nor vi-related; 4 of these are available for both Win32
_and_ linux.

Before you go downloading all these, however, see if IDLE doesn't meet
your needs. It's part of the standard Python distro and is most likely
already on your harddrive.

HTH
Tim Hammerquist
-- 
Trust the computer industry to shorten the term "Year 2000" to Y2K. It
was this kind of thinking that got us in trouble in the first place.
    -- Adrian Tyvand



More information about the Python-list mailing list