One.
Moving:
H,j,k,l: Left, bottom, top, right.
W: The first word of the next word. W: Next word (without punctuation).
E: The ending of the next word. E: Punctuation is not included.
B: The word head of the previous word. B: Punctuation is not included.
<>: Indent when v mode is selected.
Two.
Jump:
%: Can match {}, "", (), [] jump between.
H, M, L: Jumps directly to the top, middle, and bottom of the current screen.
#H: Jumps To line # of the current screen.
#L: Jumps to the bottom # line of the current screen.
ZT: The current edit line is placed on top of the screen.
ZZ: The current edit line is placed on the screen.
ZB: The current edit line is placed on the bottom of the screen.
G: Jump directly to the bottom of the file.
GG: Jump to the top of the file.
GD: Jumps to the definition of the function and variable where the cursor is located.
(): Jumps to the current beginning and end of line.
{}: Jumps up and down to the nearest empty line.
[{: Jump to the beginning of the current chunk.]
]}: Jumps to the end of the current chunk.
: Jumps to the beginning of the line.
$: Jumps to the end of the line.
$: Jumps to the end of the line on the next line.
#: Jumps to the first # position of the line.
#G: 15G, jump to line 15.
: #: Jump to # line.
Three.
Select:
. V: Turns on visual mode. V: Turn on progressive visual mode.
. ^v: Rectangle selection.
. V3W: Select three characters.
. AB: Includes brackets and areas within the ().
. AB: Includes brackets and areas within {}.
. IB: The area within parentheses ().
. IB: The area within the brackets {}.
. AW: Mark a word.
Four.
Edit:
. New:
I: Insert before cursor.
I: Inserted at the beginning of the current line.
A: Insert after cursor.
A: The current line end is inserted.
O: Insert a new row before the current line.
O: Inserts a new row after the current line.
. Modify C (change) as the main:
R: replaces the character at which the cursor is located.
R: Replaces the character where the cursor is located.
CW: Changes the word-to-tail at the cursor location.
C#W:C3W modifies 3 characters.
C: Modify to end of line.
CI ': Modifies the text content in the paired punctuation.
Di ': Delete the text content in the paired punctuation.
Yi ': Copy the text content in the paired punctuation.
VI ': Select the text content in the paired punctuation.
S: replaces the character at the current cursor.
#S: Delete the # line and replace it with the new text.
. Delete d (delete) mainly:
D: Delete to the end of the line.
X: Deletes the previous character in the position of the cursor every time it is pressed.
X: Every time you press the cursor, delete the following character at the location of the pointer.
#x: Delete the 6 characters after the cursor position.
d^: Delete to the beginning of the line.
d$: Delete to the end of the line.
DD: (CUT) deletes the line where the cursor is located.
DW: Deletes the remainder of the word after a word/cursor.
D4W: Delete 4 word.
#dd: Deletes the # line starting at the line where the cursor is located.
DaB: Deletes the contents of {} and within it.
DiB: Delete the contents of {}.
N1,N2 d: Removes the content between the n1,n2 rows.
. Find:
/: Enter keywords, find not to find, directly press N, search backwards until found.
?: Enter the keyword and find it is not looking, just press N and look forward until you find it.
*: Find the same word backwards on the current page.
#: Finds the same word forward on the current page.
. Copy y (Yank) mainly:
YW: Copies the characters from the cursor to the end of the word into the buffer.
#yw: Copies the # characters to the buffer.
Y: Equivalent to YY, copy the entire line.
#yy: Represents the number of lines of text that is copied from the line where the cursor is located.
P: Paste. All operations related to Y must be combined with p to paste.
]p: Paste to the appropriate indent.
N1,N2 CO N3: Copy the contents of line N1 to section N2 to the N3 line.
. Case conversion:
GUU: Changes the current line's letter to uppercase.
GUU: Changes the current line's letter to lowercase.
GUW: Changes the word under the current cursor to uppercase.
GUW: Changes the word under the current cursor to lowercase.
A. Whole capitalization:
Gggug
GG: The first character of the cursor to the file.
Gu: The selection range is all lowercase.
G: To the end of the file.
B. Entire lowercase: gggug
. Other:
J: The current line and the next line are merged into one line.
. Move:
N1,N2 m N3: Move the contents of the N1 line to the N2 row below the N3 line.
Vim shortcut key Reference