"vi" Unix-Linux Course Works (C) 1999
Vi is the traditional workhorse editor in Unix country. Its origins
and thus it key assignments evolved during teletypewriter terminal
days, NO CRT, no cursor keys, [h,j,k,l] were the cursor keys. left,
up, down, right.
Vi performs its tasks in THREE (3) modes. It starts, ends and performs
the commands of its predecessor 'ex' in the line mode
when you type a colon and some more. It operates in the command mode
by replying to 1 to several letter commands without echoing these commands.
And finally it has a graphic mode where it allows insertions and appends
of text which terminates with a key called the <ESCAPE> key.
vi (visual editor) help message:
is in 3 states: insert, command, line(ex)
insert-- i I insert, a A append, o O open line below/above, ends insert
command-- x X del-char, dw del-word, dd del-line, p put after, P put before
yw yank word to yank buffer, Y yank line, INTEGER may precede many of these
cw change word, C change line right of here, ends changes, ZZ exits
saving changes.
command moves-- h ( left ), j ( down ), k - ( up ), l ( right ),
w e b ( move word, word end, back ), 1G nmbrG G ( line go, end ), 0 \$
( move Beg/End of line ) .. number(s) allowed before most commands
line-- Prefixed with <:> key and terminated with key ( takes ed editor
commands in lower left corner of crt .. man ed .. ) include:
/string ?string ( search down or up for string ), q quit, q! lose changes,
w wq ( like ZZ, write or write and quit )
range cmd .. .,\$s/old/new/g from current line to eof subst old for new for
each occurence on each line
!command will execute a Unix shell command from within vi
r !command will read into current session the results of a NONINTERACTIVE
shell command.
:!man ed .. for more help.
More about Editing
|