VI Editor
VI Editor
vi Modes
Command Mode
ESC puts you in command mode vi commands (a, i, o, etc.) ex commands, prefixed with a colon (:)
Input Mode
Cont.
G #G :# Ctrl g
Ctrl b Ctrl f Ctrl u Ctrl d L M H
Go to the end of the file Go to the line number # Go to the line number # Reports the line you have gone to
scroll back to the previous window of text scroll forward to next window of text scroll up half a window of text scroll down half a window of text Go to the last line on the screen Go to the middle line on the screen Go home
Input Modes
a i O o A I append new text after the cursor insert new text after the cursor Open a line for text above the current line Open a line for text below the current line append new text at the end of the line insert new text at beginning of the line
Deleting text
#x #dw #dd dG delete the character at the cursor delete the current word delete the current line delete through the last line of the file
d$
d^
To Undo u U undo the last modification undo all modifications to current line
Moving/Copying text
p(lowercase) P #yw #yy paste contents after the cursor paste contents before the cursor yank the current word yank the current line
yG
y$ y^
Changing text
rcharacter replaces the character at the current cursor position