VI EDITOR There are two file modes 1)INSERT MODE: The insert mode puts anything typed on the keyboard into the current file 2)COMMAND MODE: The command mode allows the entry of commands to manipulate text.
i I a A r R <ESC>
Insert before current cursor position Insert at beginning of current line Insert (append) after current cursor position Append to end of line Replace 1 character Replace mode Terminate insertion or overwrite mode Deletion of text
Deleting x
delete character under cursor
dd
delete line under cursor
dw
delete word under cursor
ndd
Delete n lines (n is a number) and put them in buffer
db u
delete word before cursor Undo last command cut and paste
:w :w new.file
Write the current file. Write the file to the name 'new.file'.
:wq :q :q!
Write the file and quit. Quit. Quit with no changes.
:e filename
Open the file 'filename' for editing.
Cursor Movement h
move left (backspace)
j
move down
k
move up
l
move right (spacebar)
[return]
move to the beginning of the next line
Find Commands ?
finds a word going backwards
/
finds a word going forwards
f
finds a character on the line under the cursor going forward
F
finds a character on the line under the cursor going backwards Miscellaneous Commands .
repeat last command
u
undoes last command issue
:#
move to line #
:$
move to last line of file
MOVING