Sunday, March 16, 2008

VI Editor Tips for beginners

There are two modes in VI editor
command mode and escape mode

Press to enter in command mode
Press "i" to enter in insert mode

Delete-dd
Press
to delete one line
x
Delete one character
:wq
Save and exit

:q!
Quit without saving
^Z
suspend vi

ZZ
writes and quits at the same time
:r name
reads in the file name at the cursor point
copy and paste (yy and p) Yank

yy
yanks into a temp buffer
p
paste the yanked file

Search
==> /pattern
searches for the pattern in the file
n
carry search in the same direction
N
carry search in opposite direction

UNDO command
u
undo the last action
.
repeats the last command

No comments:

Post a Comment