[comp.emacs] Wanted: REAL vi mode for GNU emacs

cjh@hpausla.HP.COM (Clifford Heath) (07/18/88)

I am a (not altogether unenlightened) vi user.  Yes, I have a choice,
and I chose vi over Gnu Emacs because there is less typing; commands
are shorter.  Now, if someone were to write a real vi mode, that is
one that, as far as it goes, actually works EXACTLY like vi does,
and has at least half of vi's commands (together with all of EMACS
facilities, of course) then I'd change over like a shot.

So.....   WANTED, DEAD OR ALIVE, a REAL vi mode for GNU Emacs.

Please don't start a religious war over which is better, just agree
that for thousands of vi users, a real vi mode would be FANTASTIC,
and would probably wean a lot more people off this dinosaur.

For now, I'll remain a recalcitrant vi user, just to save that
bit of typing time.

Clifford Heath, Hewlett Packard Australian Software Operation.
(UUCP: hplabs!hpfcla!hpausla!cjh, ACSnet: cjh@hpausla.oz)

cjh@hpausla.HP.COM (Clifford Heath) (07/27/88)

Ok, ok, stop telling me, I already knew about vi mode and vip mode.
vip seems the more complete, but lots of things simply work differently,
which loses the advantage of having an emulation.

As I said...

> are shorter.  Now, if someone were to write a real vi mode, that is
> one that, as far as it goes, actually works EXACTLY like vi does,
					      ^^^^^^^

Having looked further at vip mode, I'm sure it's fixable; here's my
list of fix requests (please post fixes here!) most severe first:

- Deletions to end of buffer don't work, e.g. Gdd, dG etc simply don't delete.
- Word movement uses the Emacs rules which are quite inferior to vi's (opinion)
- It is possible to get stuck in insert mode.  Can't remember how I did it,
  but the only way out I found was to kill the buffer.
- After an insert, the cursor should stop on the last char inserted. Same goes
  for $ which should go TO the last char on the line, not after the last.
- There is no indication of end of buffer, and innocent movement
  commands (j, +, etc) extend the buffer.
- There are some superfluous 'Beginning of buffer' and 'End
  of buffer' messages.

Clifford Heath, Hewlett Packard Australian Software Operation.
(UUCP: hplabs!hpfcla!hpausla!cjh, ACSnet: cjh@hpausla.oz)

liberte@m.cs.uiuc.edu (07/30/88)

> /* Written 10:28 pm  Jul 26, 1988 by cjh@hpausla.UUCP in m.cs.uiuc.edu:comp.emacs */
> Having looked further at vip mode, I'm sure it's fixable; here's my
> list of fix requests (please post fixes here!) most severe first:

I hope that whoever fixes vip mode will make some of the "fixes" optional
since some people may like the way vip mode does it is better than
vi in some cases.  But because it is different, it is unfamiliar
and therefore less attractive.  Certainly all the missing commands
should be added.

> - After an insert, the cursor should stop on the last char inserted. Same goes
>   for $ which should go TO the last char on the line, not after the last.

My guess is that the reason vi works this way is that it is line
oriented and there is no end of line character.  Therefore, after
insertion at end of line, the cursor cannot be left there.  But
then there is the inconsistent behavior at the beginning of line.

> - There is no indication of end of buffer, and innocent movement
>   commands (j, +, etc) extend the buffer.

The auto extension can be "fixed" in regular emacs as well as vip mode with a
replacement for next-line (or whatever it is called - I'm using vi at the
moment, being ambieditorous).  The vi-like trailing tildes would be difficult,
maybe impossible without a mod to emacs.

Dan LaLiberte
uiucdcs!liberte
liberte@cs.uiuc.edu
liberte%a.cs.uiuc.edu@uiucvmd.bitnet

weemba@garnet.berkeley.edu (Matthew P Wiener) (07/30/88)

In article <380006@hpausla.HP.COM>, cjh@hpausla (Clifford Heath) writes:
>Having looked further at vip mode, I'm sure it's fixable; here's my
>list of fix requests (please post fixes here!) most severe first:

I'm not going to fix these.  Just clues for someone who wants to.

>- Deletions to end of buffer don't work, e.g. Gdd, dG etc simply don't delete.

That *should* be easy to fix.  But I don't know if the code makes it so.

>- Word movement uses the Emacs rules which are quite inferior to vi's

A change in syntax-table would do that.

>- After an insert, the cursor should stop on the last char inserted. Same goes
>  for $ which should go TO the last char on the line, not after the last.

Sounds either trivial or grotty.

>- There is no indication of end of buffer,

You mean the "~"s?  Oh wow, I forgot about them.  Well, I suppose putting
in 50 say fake "~"s in your buffer would be possible, and then doing a
little extra dallying when you do a save.  Yeah.

>-					    and innocent movement
>  commands (j, +, etc) extend the buffer.

That is positively gross.  I rewrote next-line to not do that long long ago,
but it's an incomplete fix to the general case.  It's the only Stallmanism
that I absolutely loathe.  (How about a flag or something?)

>- There are some superfluous 'Beginning of buffer' and 'End
>  of buffer' messages.

Sounds like he's using (beginning-of-buffer) instead of (goto-char 1) etc.
If so, it's easy to fix.

ucbvax!garnet!weemba	Matthew P Wiener/Brahms Gang/Berkeley CA 94720
"Nil sounds like a lot of kopins! I never got paid nil before!" --Groo

les@chinet.chi.il.us (Leslie Mikesell) (08/05/88)

In article <380006@hpausla.HP.COM> cjh@hpausla.HP.COM (Clifford Heath) writes:
>Ok, ok, stop telling me, I already knew about vi mode and vip mode.
>vip seems the more complete, but lots of things simply work differently,
>which loses the advantage of having an emulation.

What about ESC-ESC?  That one is the most annoying for me..  I never
have any trouble with vi "modes" because I just hit the ESC key
unless I am absolutely sure that I am already in command mode.  In fact,
you could think of each vi command being prefixed with ESC and vi would
no longer have modes...
Anyway, I would guess that many vi users fall into this habit since the
worst that vi will do if you hit an extra ESC is beep at you.  Unfortunately
this is not true for vip.

 Les Mikesell

weemba@garnet.berkeley.edu (Matthew P Wiener) (08/05/88)

In article <6199@chinet.chi.il.us>, les@chinet (Leslie Mikesell) writes:
>What about ESC-ESC?  That one is the most annoying for me..	[...]
>Anyway, I would guess that many vi users fall into this habit since the
>worst that vi will do if you hit an extra ESC is beep at you.

So put the following in your .emacs:

(defun disabled-command-hook (&rest ignore) (beep))

ucbvax!garnet!weemba	Matthew P Wiener/Brahms Gang/Berkeley CA 94720

jay@banzai.UUCP (Jay Schuster) (08/24/88)

Re: REAL vi mode for GNU emacs

OK folks, I received a number of requests for it.  It will be about a week
longer before I have access to a tape drive to get the stuff off of.
I have heard all of your requests, however, and am working on
getting the macros off of tape.

Once I get them, I will try to send them to someone with FTP
access so that the macros will be available to anyone who wants them.

-- 
Jay Schuster				uunet!uvm-gen!banzai!jay
The People's Computer Company		`Revolutionary Programming'