[comp.editors] minimum vi command set, was: Wanted: Easy, Full-screen Editor

wb8foz@mthvax.cs.miami.edu (David Lesher) (10/09/90)

>>My employer needs a simple, full screen editor that will run on a VAX 8250
>>running BSD 4.3-tahoe.  
>>I have both vi and emacs, but nether one of these are acceptable for this
>>application.  

>Reconsider vi for this.  Just don't try to teach them everything
>all at once.  

My thoughts exactly.
What do you REALLY need to use vi?

	cursor keys
	<ESC>
	i		(forget a,I,A)
	x
	u		(optional)
	J		(maybe)
	ZZ
Sure they're LOTS of things that will go slowly with only the
above, but is there any text you cannot enter or edit?
-- 
A host is a host from coast to coast.....wb8foz@mthvax.cs.miami.edu 
& no one will talk to a host that's close............(305) 255-RTFM
Unless the host (that isn't close)......................pob 570-335
is busy, hung or dead....................................33257-0335

mhcoffin@watmsg.uwaterloo.ca (Michael Coffin) (10/09/90)

I'd reconsider emacs.  Create a version with almost all the funky keys
bound to no-op.  All you really need are the cursor keys, backspace,
and delete.

A few years ago I tried to teach a computer-shy person to use vi.  It
was a disaster.  The biggest problem was the multiple modes---she
continually typed commands into the buffer, or text as commands.
After a week or so, in desperation, I introduced her to emacs.  She
immediately started typing.  Five minutes later she asked me if there
was a way to delete whole words, or something like that.  I told her
how.  A little while later she hit a wrong key and got in the
minibuffer; I had to tell her about ctrl-g.  Finally, half an hour
later I told her how to exit.  Her comment was This is easy!  Why did
you try to make me use that AWFUL vi?

-mike

cbrandau@isis.cs.du.edu (carl brandauer) (10/13/90)

I have taught more than one hundred computer shy people (clerks and other
low-level support staff) how to use vi productively in two a two day course.
The choice of the command set and the proper cycling between command and
text mode make a huge difference on how hard it is to learn vi.

jmccarty@euclid.ucsd.edu (Jon McCarty) (10/14/90)

In various articles, lots of people write:
>>>My employer needs a simple, full screen editor that will run on a VAX 8250
>>>running BSD 4.3-tahoe.  
>>Reconsider vi for this.  Just don't try to teach them everything
>>all at once.  
>
>My thoughts exactly.
>What do you REALLY need to use vi?

I've had the dubous pleasure of teaching hundreds of squealing freshmen
how to use VI as a Unix lab assistant over the last couple of years,
and I had a lot of success with a 5 minute presentation ("You ever used
a computer word-processor before?  No?  Good, that's less un-learning!")
and this print-out:

** BEGIN WASTED BANDWIDTH **
                              A QUICK GUIDE TO VI
                              -------------------
      Command Mode                        |       Insert Mode
      ------------                        |       -----------
                                          |
 Move       k                             |
 Keys:    h   l                           |
            j                             |
                                          |
 i - insert before (left of) cursor \     |
                                     >----+---->  (Now you can Type!)
 a - insert after (right of) cursor /     |
                                          |
 x - delete one character             <---+-----
                                          |  hit the [ESC] key to go back
dd - delete one line                      |  to command mode
                                          |
ZZ - Save & Quit                          |
                                          |
 u - undo last change                     |


Note:  You can delete multiple characters or lines by prefixing the appropriate
       command with a number, for example, type  5dd  to delete 5 lines.

** END WASTED BANDWIDTH **

The 'i' vs. 'a' distinction turns out to be real important, 'cuz you
need to be able to add to the end of a line.  I usually throw 'J' in
there too.
----
Jon
internet: jmccarty@ucsd.edu
bitnet: jmccarty@ucsd

nancym@microsoft.UUCP (Nancy McGough) (10/19/90)

In article <1990Oct9.013103.18799@mthvax.cs.miami.edu> wb8foz@mthvax.cs.miami.edu (David Lesher) writes:
>What do you REALLY need to use vi?
>
>	cursor keys
>	<ESC>
>	i		(forget a,I,A)
>	x
>	u		(optional)
>	J		(maybe)
>	ZZ
>Sure they're LOTS of things that will go slowly with only the
>above, but is there any text you cannot enter or edit?

When I first learned vi, the only way I could get from command mode to
input mode was with i and it drove me crazy when I wanted to input text
after the last character on a line -- I would use i to insert before
the last character, retype the last character, then type the new text,
then switch to command mode and use x to delete that pesky last character
which was no longer the last character.  My point is -- I think that
"a" should be included in a minimal set of vi commands!

Here's what I'd recommend for a minimal set:

ESC  Command Mode
h    left   
j    down
k    up
l    right
x    delete character
i    Input Mode, insert before character
a    Input Mode, append after character
o    Input Mode, insert on a new line below current line
:wq  write (save edits) and quit
:q!  quit without saving edits

For a little more power (in no particular order):

I    Input Mode, insert at beginning of current line
A    Input Mode, append to end of current line
O    Input Mode, insert on a new line above current line
R    Input Mode, replace text until ESC is pressed
r    Input Mode, replace character then return to Command Mode
u    undo last command
dd   delete line into buffer
dw   delete word into buffer
D    delete to end of line into buffer
Y    yank copy of current line into buffer
P    put buffer contents before 
p    put buffer contents after 
cw   change word until ESC is pressed
^    move to beginning of current line
$    move to end of current line
w    move forward a word
b    move back a word
J    join next line with current line
xp   exchange current character and next character
:1   move to line 1
:$   move to the last line
CTRL+b  move back a screen
CTRL+f  move forward a screen

Note that you can prepend (is that a word?) a number to many of 
these commands.  For example, 5dd deletes 5 lines.

I think I got carried away here . . .!

nancy

les@chinet.chi.il.us (Leslie Mikesell) (10/20/90)

In article <58374@microsoft.UUCP> nancym@microsoft.UUCP (Nancy McGough) writes:
>In article <1990Oct9.013103.18799@mthvax.cs.miami.edu> wb8foz@mthvax.cs.miami.edu (David Lesher) writes:
>>What do you REALLY need to use vi?
>>
>>	cursor keys
>>	<ESC>
>>	i		(forget a,I,A)
>>	x
>>	u		(optional)
>>	J		(maybe)
>>	ZZ
>>Sure they're LOTS of things that will go slowly with only the
>>above, but is there any text you cannot enter or edit?
>
>When I first learned vi, the only way I could get from command mode to
>input mode was with i and it drove me crazy when I wanted to input text
>after the last character on a line -- I would use i to insert before
>the last character, retype the last character, then type the new text,
>then switch to command mode and use x to delete that pesky last character
>which was no longer the last character.  My point is -- I think that
>"a" should be included in a minimal set of vi commands!

I'd teach D, A, dd, o, and O along with the set above right from the start
for a couple of reasons.  "A" is generally the peferred way to add to
the end of a line since it also moves the cursor to the right place.  If
you need to delete something that is already there, DA is worth knowing
about. Learning these will make that user aware that the upper/lower
case distinction is important (for the time they accidentally leave
caps-lock on), and hint at the power available from the other commands.

Les Mikesell
  les@chinet.chi.il.us

clouds@ccwf.cc.utexas.edu (Kathy Strong) (10/22/90)

In article <58374@microsoft.UUCP> nancym@microsoft.UUCP (Nancy McGough) writes:
> [stuff deleted]
>
>Here's what I'd recommend for a minimal set:
>
> [list deleted]

Nancy hits it on the nose. As an net.newcomer.vi.idiot, she's listed exactly the
commands I know (except she left out dd in the VERY basic set).

>For a little more power (in no particular order):
>
> [another list deleted]

These commands were all in my "handy dandy pocket guide to vi*" (the one that
should have been subtitled ("*if you can read this, you're too damn close")...
but Nancy's explanations were much less cryptic..

>I think I got carried away here . . .!
>
>nancy

Judging from the postings I've been reading here, many may agree--but for my
money, you can get carried away like that any time you like.

--Kathy, vi.moron



==========================================================================
|  Kathy Strong               |  "Welcome to FUBAR Corp., where there's  |
|  (Clouds moving slowly)     |   never enough time to do a job right,   |
|  clouds@ccwf.cc.utexas.edu  |   but always enough time to do it over." |