Access the vi command
Vi filename: open or create a document and place the cursor at the beginning of the first line
Vi + n filename: Open the document and place the cursor at the beginning of line n
Vi + filename: Open the document and place the cursor at the beginning of the last line
Vi +/pattern filename: Open the document and place the cursor at the first string matching pattern
Vi-r filename: a system crash occurred when vi was being edited last time, restoring filename
Vi filename... filename: open multiple documents and edit them in sequence
Move cursor command
H: move the cursor one character to the left
L: move the cursor one character to the right
Space: move the cursor one character to the right
Backspace: move the cursor one character to the left
K or Ctrl + p: move the cursor up a row
J or Ctrl + n: move the cursor down a row
Enter: move the cursor down a row
W or W: move one word to the beginning of the word to the right of the cursor.
B or B: move one word left to the beginning of the word
E or E: move the cursor right to the end of a word j.
): Move the cursor to the end of the sentence.
(: Move the cursor to the beginning of the sentence.
}: Move the cursor to the beginning of the paragraph
{: Move the cursor to the end of the paragraph
NG: move the cursor to the beginning of line n
N +: move the cursor down n rows
N-: Move n rows above the cursor
N $: move the cursor to the end of line n
H: move the cursor to the top line of the screen
M: move the cursor to the middle line of the screen
L: move the cursor to the last line of the screen
0: Note that the number is zero.) move the cursor to the beginning of the current row.
$: Move the cursor to the end of the current row