This is a continuation of our article from yesterday, Dedicated Hosting Vi Introduction (Part 1). Enjoy!
vi filename: edit filename starting at line 1
vi +nfilename: edit filename starting at line number n
vi +filename: edit filename starting at the last line
vi -rfilename: recover filename after a system crash
Moving the Cursor
space key, l, right-arrow key: one space to the right
h, left-arrow key: one space to the left
w: one word to the right
W: one blank-delimited word to the right
b: one word to the left
B: one blank-delimited word to the right
O: beginning of line
j , down-arrow: down one line
k, up arrow: up one line
): end of sentence
(: beginning of sentence
}: end of paragraph
{: beginning of paragraph
Control-F: forward one screen
Control-B: backward one screen
nG: to line n
G: to last line
Most of the above commands can be preceded by a number to iterate them.
Saving and Exiting
ZZ: save named file while in Command mode
:: Last Line mode
q!: exit without saving
w filename: give file the name “filename”
q: save named file
Adding Text
i: insert text before the cursor
I: insert text before the first character on the screen
a: insert text after the cursor
A: insert text at the end of the line
o: open a line below the current line
O: open a line above the current one
r: replace current character and return to Command mode
R: overwrite characters, starting with current character
Except for r all of the above commands put vi into Insert mode. You may return to Command mode at any time by pressing the escape key.
Go back and read – Dedicated Hosting Vi Introduction (Part 1) for more help!
More Dedicated Web Hosting Help!

