bi50xrs@sdcc3.UUCP (dragonpup) (12/05/85)
here is just a quick "beginner's" guide to vi.
no flaming please. i'm not presupposing any grand knowledge
over anyone, a friend asked me to write something and here
it is
To begin vi, just type
& vi filename <return>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Cursor Movement Commands
#h move # times left (default = 1) [ctrl-h does the same]
#j move # lines down (default = 1) [ctrl-j,n does the same]
#k move # lines up (default = 1) [ctrl-p does the same]
#l move # times right (default = 1) [space does the same]
#w move # words over (default = 1)
#W move # words over ignore puncuation (default = 1)
#b move # words backword (default = 1)
#B move # words backword ignore puncuation (default = 1)
^ move to beginning of line
$ move to end of of line
#G move to line # in file (default is end of file)
ctrl-d scroll half screen down
ctrl-f scroll full screen down
ctrl-u scroll half screen up
ctrl-b scroll full screen up
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Insert Commands
i insert BEFORE the cursor
I insert at the beginning of the line
a append insert AFTER the cursor
A append at the end of the line
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Editing Commands
c<movement> change from there to the end of the movement
d<movement> delete from there to the end of the movement
#dd delete # entire lines (default = 1)
#x delete # number of characters (default = 1)
r replace a character
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Special Commands
ctrl-r,l redraws the screen
u (undo) It undoes the last thing you did, in case you goof.
U (undo) everything you did to that line.
. (repeat) (That's a period) repeats the last command.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Colon Commands
:w write the file and save the changes
:w name same, but the changes go into a file with the new name
:q leave the editor
:q! leave file alone
:wq write and quit at the same time
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::