bi50xrs@sdcc3.UUCP (dragonpup) (12/05/85)
this is the advanced version of the previous article
again i am not claiming to be any guru on vi
yes there is a guide by berkeley. this is just for
a friend.
Advanced vi commands
to recover lost files in vi
type "vi -r filename"
[disclaimer this may not always work]
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Cursor Movement Commands
- move to the beginning of one line above
H move to top of screen
M move to middle of screen
L move to end of screen
) move to end of sentence
( move to beginning of sentence
} move to end of paragraph
{ move to beginning of paragraph
ctrl-j move one line down
ctrl-m move one line down
ctrl-n move one line down
ctrl-e display one more line at bottom
ctrl-y display one more line at top
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Insert Commands
o open open line BELOW the cursor and begin insert
O open open line ABOVE the cursor and begin insert
s substitute same as "xi"
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Editing Commands
J join two lines (remove a carriage return and concatenate)
y<movement> - yank lines into a buffer
#Y yank # lines into buffer (default = 1)
P to put lines from buffer BEFORE the cursor
p to put lines from buffer AFTER the cursor
~ change from upper to lowercase or vice versa
#>> shift # lines usually 8 spaces to the right (default = 1)
#<< shift # lines usually 8 spaces to the left (default = 1)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Search Commands
/pattern - searches for "pattern" after the cursor
?pattern - " " " before " "
n next - keeps searching in the same direction
N " - " " " " opposite direction
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Special Commands
editting two or more files at a time [not advised to edit more than 2]
"vi file1 file2"
:n moves to next file
:rew! returns to previous file
:e# does the same as the above
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Colon Commands
:#1,#2 w name write only the lines #1 to #2 to the file (for excerpting)
:r filename read in a file into the text after the cursor
:!shell-command execute a shell-command put result at bottom of screen
:r!shell-command execute as above, but put result before cursor
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Buffer Commands
m<a-z> mark <a-z> as a spot note the "< >" are not typed
'<a-z> return to that spot
"<a-z> lowercase lettered buffer
"<1-9> last 9 text deletions in backwards order
"my'a yank from mark a into buffer m
"mp put from buffer m
"My'a append to a
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::