No Next Item No Next Conference Can't Favor Can't Forget Item List Conference Home Entrance    Help
View Responses


Grex Info Item 71: Unix Editors -- Discuss, Compare, and Debate
Entered by remmers on Thu Aug 26 12:45:54 UTC 1993:

This item is to discuss and compare editors commonly found in Unix
environments, noteably 'vi' and 'emacs'.  As people tend to be
pretty fervent in their editor likes and dislikes, the discussion
is apt to look like a religious debate.

Response #1 is a copy of relevant responses from an item in the Coop
conference that had drifted onto the subject of editors.  It's rather
long, and if you've already read that item, you might want to hit
your interrupt key and start reading this item with response #2 by
typing 2 at the "Respond or pass" prompt.

96 responses total.



#1 of 96 by remmers on Thu Aug 26 12:47:02 1993:

#36/14 by Raised in a Vacuum....tube (aa8ij) on Tue, Aug 24, 1993 (17:45)
   vi is not that bad. Once I read Valerie's guide to vi, I learned it,
 and I have grown to love it. I will not let you slam vi.

---
#37/14 by Dave Lovelace (davel) on Tue, Aug 24, 1993 (19:52)
 And just how do you propose to stop him?
 

---
#38/14 by Greg Cronau (gregc) on Tue, Aug 24, 1993 (20:08)
 Let me tell you something, As a computer professional that spends an 
 average of 9 hours a day sitting in front of a tube writing software,
 using vi for a considerable amount of that time, I will tell you that
 vi sucks!!! I have learned vi because it is on every system that I use,
 and is available on *any* unix system, I have *accommodated* it, but I
 will *never* love it. It is too alien to my way of doing things.
 
 Any editor that assigns a different meaning to a particular key, based on
 what mode you are in, and then gives you absolutely no visual cue as
 to what that mode is, should be sent to it's own private circle of hell.

---
#39/14 by John H. Remmers (remmers) on Tue, Aug 24, 1993 (21:04)
 <EDITOR RELIGIOUS WAR ALERT!>

---
#40/14 by Greg Cronau (gregc) on Tue, Aug 24, 1993 (23:25)
 Yeah, I know, sorry about that. It's a sore subject that's all.

---
#41/14 by Patricia Snyder-Rayl (pegasus) on Tue, Aug 24, 1993 (23:32)
 Greg,
 
 That's ok. :) We understand.. it's like me and the phone company. Don't
 even get me started! *huge grin*

---
#42/14 by Meg Geddes (meg) on Tue, Aug 24, 1993 (23:39)
 (vi or die)

---
#43/14 by Steve Weiss (srw) on Wed, Aug 25, 1993 (00:12)
 I have always been afraid to say what gregc said because of fear of
 starting a religious war. It needed to be said. vi sucks. It does so
 precisely because of its modal nature. I, too, have accommodated,
 since I had to. Kicking and screaming. Ahhhhhhhhhhhhhh. (kick kick)
 
 It's delightful that here on Grex I have the alternative to use the
 far superior jove. Full Emacs would be a delight, but is not necessary.
 (duck!)

---
#44/14 by John H. Remmers (remmers) on Wed, Aug 25, 1993 (02:30)
 Full GNU Emacs is available now.  For proof, type !emacs at the next
 prompt.

---
#45/14 by John H. Remmers (remmers) on Wed, Aug 25, 1993 (02:32)
 (Oh, and for the un-emacs-knowledgable, you type control-x control-s
 to get out.)

---
#46/14 by Kent Nassen (kentn) on Wed, Aug 25, 1993 (09:21)
 (I thought it was control-x control-c)

---
#47/14 by Greg Cronau (gregc) on Wed, Aug 25, 1993 (10:35)
 emacs is even worse than vi. <gregc ducks and runs for cover>

---
#48/14 by Jared Mauch (jared) on Wed, Aug 25, 1993 (11:27)
 No.. Emacs is cool.. you used to be able to change the password file with
 the bugs that are in it.  <grin>

---
#49/14 by John H. Remmers (remmers) on Wed, Aug 25, 1993 (13:40)
 (Oops, right, control-x control-c to exit emacs...)
 
 Ye gads, vi and emacs *BOTH* bad?  What's an example of a good editor,
 then?
 
 Since we're on the subject of editors, I'll just that once I got over
 the modedness hurdle of vi and took the time to learn the command
 structure, I have no big problem with vi.  The command set is actually
 very well designed, and it's an advantage in speed for a touch typist's
 hands never to have to leave the home row.  I find vi to be just fine
 for small to moderate size editing jobs.  The ability to import
 arbitrary Unix commands and have them operate on the editing buffer
 using the "!" feature is a *wonderful* feature.  The only thing that
 vi lacks that's important to me is support for multiple windows,
 although some vi clones do have this.
 
 GNU Emacs is extremely powerful and I use it a lot too, particularly
 version 19 on my home linux system under X windows, where it supports a
 mouse, multiple frames, and cut & paste with other applications.  I've
 found no better editor for medium to large scale programming projects --
 great "C mode" for automatic formatting of source code, ability to
 compile and test within the editor.  I can roll my own "integrated
 environment" and set it up pretty much the way I want to, not the
 way Borland or some other vendor wants me to.

---
#51/14 by vi or ... vi? (davel) on Wed, Aug 25, 1993 (17:03)
 I mostly agree with John's comments on vi, except - John, how do you do an
 escape without leaving the home row?  This is a real pain.

---
#52/14 by John H. Remmers (remmers) on Wed, Aug 25, 1993 (17:17)
 That's true, on most keyboards, although mine has a spare escape key
 just to the left of the spacebar (real good idea, in my opinion).

---
#53/14 by Steve Weiss (srw) on Wed, Aug 25, 1993 (17:56)
 Re #49, John, are you telling me that you never insert strings of j's
 or k's or other vi commands because you always remember to escape
 back to command mode? I'm impressed. I've been using vi for a lot
 longer than it has ever taken me to master far more complex editors,
 yet I still find myself backing up over these errant commands which
 turned into part of my buffer because I didn't escape. It's not that
 I don't know how it works, it's that it's really hard to get it
 right. And the cost of getting it wrong is wasted effort.
 
 I am claiming not that vi has a limited feature set (though it does)
 but rather that its architecture is inherently unfriendly.

---
#55/14 by Greg Cronau (gregc) on Wed, Aug 25, 1993 (18:52)
 Ok, I suspected I was starting an editor religous war when I entered that
 item. Oh, well.....
 
 John, to be honest, I have not yet found an editor in the UNIX environment
 that I am really happy with. Crisp looks like it has potential, it is a
 clone of Brief for the PC environment. Unfortunately, I just don't have the
 time to learn another editor.
 
 I got my start on microcomputer's in the late 70's. I worked on apples,
 commodores's, CP/M, PC's, etc., until the mid-80's. I've been pretty much
 a UNIX jock for the last 7 years, but I learned to type in the PC environment.
 
 I have heard countless variations of the argument: "I am a touch typist and
 I don't want to slow myself down by removing my hands from the keyboard."
 Now, this *is* a good argument against using mice to manipulate the cursor,
 ala X or Windows.
 
 But, I learned to type in an environment in which every keyboard had a cursor
 pad. I am a touch-typist too, a fairly fast one for a programmer, but I
 have incorporated the cursor keys *into* my touch typing. My fingers
 instinctively know where the arrow keys are. The right-most 2 fingers of
 my right hand are ussualy over the pad. It's instinctive.
 
 I work best with an editor that allows modeless operation. You want to type
 an "A", you hit the "A" key. You want to move the cursor up a line, you
 hit the cursor up key. Period. I move around the screen *alot* when I work,
 and this need in vi to: "Enter insert mode, type text, leave insert mode,
 move cursor, enter insert mode, etc, ad nauseum. It DRIVES ME NUTS SOMEDAYS!
 
 On my machines that I do real work, I have managed to comp up with a
 combination of:
 1.) A special keyboard mapping.
 2.) A special terminfo/termcap entry.
 3.) And a set of .exrc macros
 The above combination allow me to use vi in a modeless way. It works about
 98% of the time, however I still have problems getting exactly the operation
 that I want when the cursor is at the beginning or end of a line.
 
 I have seen a couple of customized version's of vi for the PC that do 2
 things right:
 1.) The cursor keys are hardcoded to *always* do the-right-thing.
 2.) The screen cursor changes shape depending on what mode you are in.
 #2 is a big gripe. I don't like the fact that there is no visual cue to
 tell you what the current mode is. The result is that I end up hitting the
 escape key far more than is necasary just to be-sure.
 
 There is a mode that is supposed to put the words "INSERT MODE" and
 "APPEND MODE" on the status line. But I have yet to find an implementation
 of vi that sets and clears this text correctly all the time. It ussually
 displays the text just fine when insert mode is entered, but doesn't clear
 it when escape is hit.
 
 OTOH, vi does have a lot of neat, powerful, features. There is alot I do
 like about it, but the biggest issue is I need to be able to cleanly
 enter text, if I can't do that, all the bells and whistles are worthless.
 
 Oh, yeah, I havn't installed my vi enhacements on Grex because it's too
 slow. Once we're on the 3/260, I plan to put them here. I'll show you
 how they work then.

---
#57/14 by Raised in a Vacuum....tube (aa8ij) on Wed, Aug 25, 1993 (20:33)
  Vi can bbe a pain when you're using a Mac that has no escape key.

---
#58/14 by John H. Remmers (remmers) on Wed, Aug 25, 1993 (20:35)
 Re #53:  I consider vi to be my friend.  Cantankerous sometimes, but
 a friend nonetheless.  Differnt strokes for different folks, I guess.
 Yes, I do enter strings of j's and k's sometimes.  I live with it.

---
#59/14 by Steve Weiss (srw) on Thu, Aug 26, 1993 (01:10)
 OK John, it sounds like we agree more than disagree. the only difference
 seems that you put up with vi's annoyances more willingly than I.
 I live with it too on my Unix machines at work, since vi is all there is.
 I'd rather put up with vi than hassle everyone there (they all love vi).
 I just cannot call vi a friend when it fights me so hard.
 
 No vi implementation I have used yet did any of the helpful things
 gregc suggested vi is supposed to do. Greg, I am totally with you on
 the use of cursor keys. It's totally natural. I thought emacs had
 an out-of-the-box Brief-Emulation mode. Why doesn't that make you
 happy?

---
#61/14 by Greg Cronau (gregc) on Thu, Aug 26, 1993 (04:49)
 <non-editor stuff deleted>
 
 Re #59: srw
 Steve, well, like I said, I don't really know crisp *or* brief, but I've
 seen it, and I know it *can* do what I want with the proper configuration.
 I suspect that if I put enough time into configuring emacs, I could make
 it do what I want too, but I just don't have the time to futz with it these
 days. But at least vi makes an attempt to keep all the default cursor motion
 keys grouped in one place on the keyboard in a semi-logical manner: HJKL.
 
 Emacs *default* behavior, of ^p for previous, ^n for next, ^b for back, and
 ^f for forward, scattering the cursor motion all over the keyboard, is even
 *more* braindead than vi.

---
#62/14 by Glenda F. Andre (glenda) on Thu, Aug 26, 1993 (07:50)
 I used to use ed, knew it inside out and could do almost everything I
 wanted, the few things that I couldn't I really didn't need all that often
 and I figured out ways around it.  STeve mentioned that I could do those
 things in vi.  Took one look at it and ran away screaming.  He persisted
 in working on convincing me to try it (took him a couple of years).  Finally
 I tried it (with a cheat sheet that he thoughtfully provided) and fell in
 love. I've forgotten what I knew about ed and plan to never remember it again.

 I now use vi for most straight text entry (the version we have on our home
 system has the cursor keys hardwired so that I can move around the screen
 freely even while in insert mode).  I switch to Word if I have to do anything
 fancy.  I know there are other, better things out there but, like gregc, I
 have other things to do with my time than try to figure out yet another
 editor when I know the one I use and can make it do what I need it to do.


#2 of 96 by srw on Fri Aug 27 00:47:38 1993:

Re #61, gregc, I must have misunderstood what you meant in #55, as I
got the impression that you knew brief. Obviously my comments were
inappropriate if you didn't.

Regarding the default arrows in emacs, I agree. But it's so easy
to map them to my arrow keys. I can't map anything in vi, but
mostly I can't map its modalness into the bitbucket.

Those who are willing to tolerate this modalness will be able to 
love vi. I cannot, because a good editor does not need to be modal.
In fact, I believe a good editor *cannot* be modal, but that's
because I think a good editor should not have a steep learning
curve. vi has such a steep learning curve, and I downrate it
for that.


#3 of 96 by jared on Fri Aug 27 07:34:36 1993:

View hidden response.



#4 of 96 by jared on Fri Aug 27 07:37:37 1993:

And you don't have the CENSOR command on grex, do you?


#5 of 96 by jared on Fri Aug 27 07:38:00 1993:

(but it's pico stuff.... jared.. please don't complain anymore.. we're
 just too bad..)


#6 of 96 by popcorn on Sat Aug 28 04:18:18 1993:

This response has been erased.



#7 of 96 by popcorn on Sat Aug 28 04:21:44 1993:

This response has been erased.



#8 of 96 by gregc on Sat Aug 28 05:23:00 1993:

My problem is worse than entering j's and k's into my document. Since
I'm accustomed to using the cursor pad, if it's not mapped correctly, I
end up ending multiple characters per keypress, ussually control
characters and ussually characters that do random messey things to my
text.

Being in insert mode when you think you are in command mode and inserting
command text is bad, but what is *worse* is being in command mode when
you think you are in insert mode. Too many times I've typed in a key
couple of words while I glanced away from the screen to look at my notes,
and looked back to find that everything was garbage because my text had
been interpreted as commands. *That* aspect is the thing I find most
unforgiveable about vi.

Valerie, the advice about cursor position at the end of the line is
fine if you are entering new code for the first time, but I find that
95% of the time, I'm moving all around a program and the cursor is
ussually anywhere on the screen, so it's little help.

And yes, vi has tons of nice fancy features, I use alot of them, but
all the fancy features in the world arn't worth squat if the editor
fights you on doing the very simplist, and most commonly performed, act:
simple text entry and editing.




#9 of 96 by srw on Sat Aug 28 07:15:23 1993:

Like you, greg, I also have typed text in command mode, but the u
command usually undoes the damage, so I don't consider that to be
any worse than the strings of jjjj I wind up typing (and then erasing).

Valerie's cursor position check does work.  I guess I must be using
a different definition of ease-of-use than vi lovers do, because I
find it easier (but unpleasant) to type the j and then erase it,
than I would to figure out whether the cursor is on or after the
last character I typed.


#10 of 96 by remmers on Sat Aug 28 14:43:16 1993:

It should be remembered that vi was designed in the 1970's, at a time
when there was virtually no standardization of keyboards (many keyboards
didn't even *have* arrow keys) and lots of people were still using hard-
copy terminals, or very low baud rates like 300 or even 110.  Bill Joy
wanted to design an editor that could be used with virtually any keyboard
and display (even a hardcopy DecWriter) and whose screen updating performance
would be tolerable at low baud rates.  So he invented the termcap facility
for describing terminals, and wrote vi.  The design constraints account for
some of the characteristics of vi that nowadays seem strange.


#11 of 96 by popcorn on Sun Aug 29 02:45:54 1993:

This response has been erased.



#12 of 96 by srw on Sun Aug 29 04:59:07 1993:

Re #10, John, those are good points. Although I didn't know the
original designers name, nor the exact time vi was written, it was a
success. I have great respect for what vi accomplished in its day.

Now that editing with arrow keys is possible, I think that
we should do so rather than using the difficult modal structure of vi.

I will grant that it is human nature to avoid changing editors. Once
you learn one well, it is too much of a friend to give up. I have
seen colleagues with decades of experience defend clearly
inferior editors, simply because they didn't want to learn a new one.
I believe this is why experienced unix users adhere to it so strongly.

I am not an emacs lover, I just appreciate its configurability,
non-modal design, and multiple windows. I don't know how to get split
windows in vi (although I think popcorn said she did that). My
favorite editor is neither vi nor emacs, but rather MPW, but I can't
run that here. I like it so much because I can use arrow keys in
conjunction with shift,option, or command modifiers. These
combinations are consistent and make sense, so its learning curve is
not too steep, either. Alas it will die, soon.

Brief and Sage editors for PCs are both easy to use.
(There are many others, good and bad, that I am not familiar with, for PCs).
BBEdit will probably replace MPW on a MAC.
EVE (on VAX/VMS) probably deserves to be classed with the above.
Emacs is somewhat comparable to these, vi is not at all.

Obviously, this whole response is "IMO".


#13 of 96 by mju on Sun Aug 29 05:55:58 1993:

I don't think vi supports split-window operation.

I poersonally use Emacs for most editing; the cursor commands are
somewhat odd, but you can rebind them to whatever you want.  You
can even use the arrow keys if your terminal is set up correctly.
And I haven't yet found something you can't do in Emacs, which
is more than I can say for vi.  vi is nice when you need a small
editor which doesn't take too long to start up; I even use it
for small editing jobs.  But for anything big, or C or Perl code,
I always use Emacs.


#14 of 96 by remmers on Sun Aug 29 12:01:01 1993:

Re #11:  I believe that Bill Joy was at U of M before he went out to
Berkeley; he may have written the MTS visual editor.

Vi does not support multiple windows, although some of the vi clones do.

I'm sort of neutral on the issue of arrow & function key support.
The vi's that I use are all configured to support arrow keys, and 
sometimes I use them, but I usually find it more convenient to use
the hjkl keys for cursor motion, because my hand doesn't have to leave
the home row.

Like Marc, my tendency is to use GNU Emacs for large jobs, because of
its greater functionality, and vi for small ones (like editing this
response).  The Emacsen that I use all support arrow keys, but again,
I usually use the default control-keys (ctrl-p = up, ctrl-n = down,
ctrl-b = left, ctrl-f = right) for cursor motion.  Gregc is going to
think I'm distinctly weird for saying this, but the fact that those
keys are scattered around the keyboard doesn't bother me, any more
than the fact that the 'a' key is not near the 'b' key.  I've simply
incorporated those keys into my touch-typing repertoire, and my fingers
go to them automatically when I want to use them.  Their location doesn't
slow me down.


#15 of 96 by srw on Sun Aug 29 13:34:47 1993:

Interesting point about the home row, John. I hadn't considered that
clever bit of vi design. I am *not* a touch typist. So being in the
home row seems to offer me no advantage. Now I can clearly see that
touch typists would like that.

What we are discussing here (our personal preferences) is kind of
interesting, to a point. We all like different keys, but we can
configure most editors wrt key bindings. The only reason hjkl are
available to vi and not to the other editors, is that vi has
chosen an architecture that allows hjkl to mean one thing some of the
time, and another thing at other times. This is workable, as we all
can use it. It is even appropriate when keys are limited.

Keys are no longer limited, and the big downside is that it's harder
to learn and become adapted to any system where a key can have
context-dependent meaning. Only vi does this. I am sure I would
tolerate vi better if I had a very limited keyboard. (in fact, I
would probably rail against the keyboard, rather than vi.)

Now that I think about it, other editors support modes too. They
typically have an "overstrike" and an "insert" mode which can be
toggled between by some ctrl character. I find this modal behavior
difficult to use, too, in the sense that I get it wrong some % of
the time. The only differences between this design and vi's modes
are (1) I need overstrike far less often than vi's escape, so the
issue doesn't come up as much, (2) I don't see a good alternative
at the moment. (3) at least a always types an a, b a b, etc.


#16 of 96 by kentn on Sun Aug 29 16:44:37 1993:

A friend of mine and I discussed selling a vi-ESC-foot-switch once.
Just joking, of course, but poking that esc key all the time is a big
pain.  I wish Qedit was available for Unix...


#17 of 96 by gregc on Sun Aug 29 17:28:09 1993:

John, you cursor key impaired slut.....

You are distinctly weird.
Or weirdly distinctive.

:-)



#18 of 96 by remmers on Sun Aug 29 19:05:46 1993:

Guess I asked for that...

Hey, I kind of like the idea of an ESC-foot-pedal.  In fact, how about
a series of foot pedals, corresponding to the escape key, the control
key, the alt key, and one for overstrike mode.  There are pedal
harpsichords and pedal organs, so why not pedal keyboards?


#19 of 96 by danr on Sun Aug 29 20:23:08 1993:

Speaking of foot pedals, I've got one.  It connects to the parallel port
and comes with software that lets you program it to any key you so
desire.  It's called PC-Pedal.  I've got it in a box somewhere, and
if any of you are really interested, I'll dig it out and post the 
name of the company.


#20 of 96 by remmers on Sun Aug 29 22:12:37 1993:

Interesting.  Though I don't think I'd be interested in anything less
than two pedals, one for each foot.


#21 of 96 by mju on Mon Aug 30 04:12:39 1993:

I'm fairly sure that someone (maybe at MIT Athena) has Ctrl and Meta
footpedals, specifically for use with Emacs.


#22 of 96 by tsty on Tue Aug 31 06:30:12 1993:

Pull out the stops, here comes the MaxiEditor!


#23 of 96 by jared on Tue Aug 31 22:12:36 1993:

I was on M-net, and found an editor named JOE.  it's like qedit
for UNIX, actually.  I liked it.


#24 of 96 by kentn on Wed Sep 1 04:11:33 1993:

Is it freely available? (where, where?)


#25 of 96 by remmers on Wed Sep 1 09:24:41 1993:

(I sense the presence of a qedit fan...)

I believe it is freely available and that I've seen it on various
ftp archive sites.  Can't remember a specific location offhand, but
it shouldn't be too hard to find.


#26 of 96 by danr on Wed Sep 1 16:37:22 1993:

qedit's pretty good, actually.  That's what I use on the PC when
I need a plain ASCII editor.


#27 of 96 by kentn on Wed Sep 1 23:54:34 1993:

Well, I found JOE by looking at the sources over at M-Net.  Here's where
I ftp'd it from (and it was pretty easy to compile):
 
Joe's Own Editor 1.0.7  (actually you can get 1.0.8 now, too)
Get it by anonymous ftp
from: 'world.std.com', file '/src/editors/joe1.0.7.tar.Z'
 
Of course, I don't like the key bindings, but it looks like they can
be changed in one of the *rc files that go with JOE.  I'd love to get
it set up to accept Qedit commands...


#28 of 96 by vidar on Sun Sep 12 21:36:23 1993:

emacs?  I ain't never heard o' that one.


#29 of 96 by remmers on Mon Sep 13 00:34:20 1993:

Emacs isn't just an editor -- it's a way of life!


#30 of 96 by kentn on Mon Sep 13 03:25:59 1993:

or it can consume your life, same difference, I guess.


#31 of 96 by aa8ij on Mon Sep 13 04:49:30 1993:

  jove is neat, but VI is the best.


#32 of 96 by davel on Mon Sep 13 09:50:36 1993:

Learning vi was bad enough.  I gave up on emacs without actually ever
managing to successfully edit a single file.


#33 of 96 by remmers on Mon Sep 13 22:42:01 1993:

Try the online tutorial sometime -- run 'emacs' without a filename
argument, then type   control-h t  .  You get into a hands-on
tutorial that explains the basics.


#34 of 96 by mju on Mon Sep 13 22:43:34 1993:

boot> <cr>
loading /vmunix.el...


#35 of 96 by davel on Mon Sep 13 22:56:34 1993:

Of course - control-h t .  How could I have missed trying that?


#36 of 96 by kentn on Tue Sep 14 03:31:22 1993:

Control-h t is fine unless control-h is your delete.  Esc-x help-something
something will also do the trick.  (I keep using the tab key to fill in
the possibles for emacs' minibuffer; seems to work okay).


#37 of 96 by srw on Tue Sep 14 05:50:39 1993:

Tab-completion is your friend.


#38 of 96 by davel on Tue Sep 14 09:48:08 1993:

Control-H is indeed my delete.


#39 of 96 by remmers on Tue Sep 14 10:46:49 1993:

Hmm.  Control-H is my erase character on Grex, but emacs overrides that
and makes it my help character.  Not sure why that doesn't work for you.

I think the little disclaimer that pops up when you run emacs tells you
how to invoke the tutorial.


Next 40 Responses.
Last 40 Responses and Response Form.
No Next Item No Next Conference Can't Favor Can't Forget Item List Conference Home Entrance    Help

- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss