Linux applications: Vim quick operations and vim quick operations
1. Delete characters
<Normal mode>
X: Delete characters under the cursor
Dd: deletes a whole line, including line breaks.
J: Delete the line break of the current row. It can be executed anywhere in the current row.
2. Undo and undo
<Normal mode>
U: undo the last operation. Continuous execution will be unperformed continuously.
U: undo the row. undo all the last modification to the row.
Ctrl + R: undo, undo the Undo of u (lower case), (invalid for U (upper case? Invalid even press ?)
3. Enter the editing mode.
<Normal mode>
I: Enter edit mode, start position before the character where the cursor is located
A: Enter the editing mode. the start position is behind the character of the cursor.
O (lower case): Enter edit mode and Insert a new row under the row where the cursor is located
O (uppercase): enters the editing mode and inserts a new row above the row where the cursor is located.
4. Exit Vim
<Normal mode>
"ZZ": Save and exit
": Wq": Save and exit
": Q! ": Do not save, exit
5. View help
<Normal mode>
": Help": opens the help document window. You can exit the help document by exiting the Common Document. +
Ctrl +] (parentheses): jump to a hyperlink (Hyperlink is shown in the help document as "|... |)
Ctrl + T: Jump to the location of the previous tag
Ctrl + o: Jump to the Last edited place, and may jump to other documents
": Help {option}": displays the help document for the specified operation.
": Help Exx": displays the help document for error codes. xx indicates the error code.
6. Quick mobile
<Normal mode>
W: move forward to the next character at the end of the word
E: move forward to the end of a word
B: Move backward to the beginning of the word
Ge: Move backward to the end of the previous word
$: Move to the end of the row
^: Move to the first non-null character of the row
0 (number): Move to the first character of the row
Fx: move forward to the next character of the row "x"
Fx: Move backward to the first character of the line "x"
%: The current cursor is not on the brackets (various parentheses). If there is a bracket character in the row, move forward to the first bracket.
The current cursor is in parentheses, And it is moved to the brackets that match the brackets (cross-row is allowed)
NG: Row n to the file
Gg: Move to the 1st rows of the file
H: Move to the first line of the current screen
M: move to the middle line of the current screen
L: Move to the last line of the current screen
Ctrl + U: Scroll down the half screen (the half screen is displayed)
Ctrl + D: Scroll up the half screen (the half screen is displayed)
7. Confirm the current row
<Normal mode>
Ctrl + G: displays detailed information about the current cursor position
": Set number": display the row number (short command: ": set nu ")
": Set nonumber": do not display the line number (short command: ": set nonu ")
": Set rcursor": displays the cursor position information in real time (lower right corner)