vi vs. Emacs
It took a little longer to prepare for this
month's column:
Nomex suit? ...Check!
Kevlar vest? ...Check!
Elbow pads? ...Check!
Helmet? ...Check!
Ready? ...Ready!
OK. Here is the entire column, in a nutshell:
Emacs rules.
vi drools.
Right about now, all the Emacs users are surfing off to other parts of
the magazine, wondering why I'm restating the obvious. All the vi users
are angrily sending e-mail that reads something like this:
You are a blithering idiot! Emacs is the worst editor ever
invented! I learned vi and I've never needed anything else!
:wq!
^[kdd:w!q!ZZ
^C^D.exit
quit
logout
The rest of you are probably wondering what on Earth I'm talking about.
Back to basics
When developing software, the most important tool at your disposal is
your text editor. It must be robust, extensible, easily learned, and
productive. You will probably spend more time using your text editor
than any other tool. It should fit like a glove and be as comfortable
as an old shoe.
Within the world of Unix software development, there are two principal
choices for editors: Emacs and vi. Invariably, the people who choose
Emacs loathe vi, and those who choose vi are appalled by Emacs. In case
you hadn't figured it out by now, I'm in the former camp. In spite of
my obvious bias, I'll still try to give a brief overview of each tool,
expanding on the virtues and drawbacks of each.
Emacs: the tool of tools
Emacs is a freely available editor originally written by Richard
Stallman and since enhanced by thousands of enterprising contributors.
It is distributed by the Free Software Foundation and is available in
both source code and precompiled forms. (You can ftp a copy from the
/pub/gnu directory at prep.ai.mit.edu or one of numerous mirror ftp
sites. ) It supports both
character-based and X Window environments and runs under a wide variety
of operating systems, including Unix, DOS, and Windows.
Emacs has been written by programmers for programmers. Its single best
feature is that it is infinitely extensible by means of a built-in LISP
interpreter. Almost every command in Emacs is actually a tiny little
LISP program that acts upon your text files. To extend Emacs, you
simply modify the existing programs or add a few of your own.
Emacs is known as a "modeless" editor, meaning that it is always ready to
both accept text as input and act upon that text via user commands.
You never switch between "command" and "input" modes in Emacs.
In Emacs, modes exist for just about
every conceivable programming language
-- even languages like HTML.
New users are sometimes confused by the fact that Emacs does have
various operating modes that determine how text in a particular buffer
will be handled. For example, Emacs has a "C" mode that understands how
C programs are formatted. As you type your source code, Emacs
automatically indents and formats your code. In the X version, it will
even render function names and other language elements in
Essential JavaFX
Get started building rich Web apps quickly with an introduction to the power of JavaFX key features -- scene node graphs, nodes as components, the coordinate system, layout options, colors and gradients, custom classes with inheritance, animation, binding, and event handlers.Enter now!
The Nomadic Developer
Consulting can be hugely rewarding, but it's easy to fail if you are unprepared. To succeed, you need a mentor who knows the lay of the land. Aaron Erickson is your mentor, and this is your guidebook. Enter now!












