Abstract:
1) move the cursor in the screen;
2) move the cursor inside the row;
3) screen scrolling;
Vi & vim has the compilation mode and command mode. The following cursor movement operations are performed in command mode;
The following uses the ^ character to indicate that the Ctrl key is pressed. For example, ^ F indicates that the Ctrl and F keys are simultaneously pressed;
In the following, press a key with the + sign and then press another key. For example, z + Enter indicates that the z key is pressed first, and then the Enter key is pressed;
1. move the cursor on the screen:
In vi & vim command line mode, the cursor position is moved to the front of the word and letter to be edited.
Button operation description
H move the cursor one character to the left;
J. move the cursor down a row;
K move the cursor up a row;
L move the cursor one character to the right;
Numeric value + G cursor move to the beginning of the row referred to by "numeric;
^ H move the cursor to the beginning of the first line on the current screen;
^ M move the cursor to the beginning of the row in the middle of the current screen;
^ L move the cursor to the beginning of the last line displayed on the current screen;
2. move the cursor in the file row:
In vi & vim command line mode, the cursor is moved inside the line. Words are separated by spaces. punctuation marks are considered as a word.
Button operation description
0 (number zero) move the cursor to the beginning of the row where the cursor is located;
$ Move the cursor to the end of the row where the cursor is located;
W move the cursor to the beginning of the next word;
B. move the cursor to the beginning of the previous word;
E move the cursor to the end of the word where the current cursor is located;
3. Screen scrolling:
Button operation description
^ F the screen is scrolled down;
^ B: the screen is scrolled up;
^ E scroll down a line;
^ Y the screen scrolls one line up;
^ D. Scroll down the half screen;
^ U screens scroll up half screen;
Z + Enter scroll the screen to make the row where the current cursor is located in the first line of the screen;
Z +. Scroll the screen so that the row of the current cursor is in the middle of the screen;
Z +-scroll the screen to make the row where the current cursor is located in the last line of the screen;