are all moving in command mode:
J----> Down
K----> Up
L----> right
H----> Left
Save:
W----> Save
Exit:
Q----> Exit
Q!---> do not save forced exit
Positioning:
Number, G: Quickly navigate to the beginning of a line
G----> Navigate directly to the beginning of the last line of the file
1G, or GG----> Quick position to First line
Delete command:
X: Delete one character after cursor
X: Delete one character before cursor
DD: Cut, delete when moving forward
Number, DD: Deletes the n rows at the beginning of the current line, including the forward
D: Delete all contents of the line after the cursor, including the character of the cursor
D0: Delete all contents of the line before the cursor, not including the character of the cursor
Undo command:
U: Step-by-step undo
Ctr-r: Anti-revocation
Text line movement:
>>: Text line moves right
<<: Text line shift left
Start line, end line: Indent to the right, how many, how many times to indent
Start line, end line <: Indent to the left, how many <, and how many times to indent
Copy and paste:
YY: Copy when moving forward
Number, yy: Copy n rows
P: Open a new line at the cursor position, paste
DD: Cut, delete when moving forward
Replace:
R: The character of the cursor is in the replaced state
%s/main/main/g: Replace main with main,% for all, can be replaced by 5, 15, indicating the number of rows
Find:
/: Enter the query status, enter the content you want to find
N: Look down
N: Find up
The command mode changes to edit mode:
I----> Insert a character before the cursor
A----> Insert a character after the cursor
I----> Insert the beginning of the line
A----> Insert end of Line
o----> Down new line, insert beginning
O----> Open a new line, insert beginning
Vim commands that are commonly used