Command |
Description |
Memory methods |
1. Move the cursor |
|
|
B |
Move backward to the beginning of the current/previous word |
|
W |
Move forward to the beginning of the next word |
|
E |
Move forward to the end of the current/next word |
End |
Ge |
Move backward to the end of the previous word |
|
W |
Move forward to the beginning of the next string |
|
B |
Move backward to the beginning of the current/previous string |
|
GE |
Move backward to the end of the previous string |
|
|
|
|
2. Single-line Lookup |
|
|
F{char} |
Find the Char,char of the current row can only be a single letter |
|
; |
Find Backward |
|
, |
Search forward |
|
|
|
|
3. Move the cursor between text |
|
|
10k/10j |
Up/down 10 lines |
|
Ctrl+f |
Page Down |
Before |
Ctrl+b |
Page UP |
After |
|
|
|
[] |
Jump to the first line |
|
Gg |
Jump to the first line |
|
][ |
Skip to last line |
|
G |
Skip to last line |
|
: {num} |
Skip to Num Line |
|
|
|
|
H |
Jumps to the first line of the current screen |
H=high |
M |
Jumps to the middle row of the current screen |
M=middle |
L |
Jumps to the last line of the current screen |
L=lower |
|
|
|
Ma |
Sets a bookmark named A at the current cursor position (book signature range [A-z]) |
M=mark |
' A |
Jump to bookmark a |
|
|
|
|
{ |
Skip to previous paragraph |
|
} |
Skip to next paragraph |
|
|
|
|
4. Delete |
|
|
di{symbol} |
Delete everything inside the symbol, such as di ', delete ' all content inside |
Delete in |
da{symbol} |
Same as above, but with symbols also deleted |
Delete all |
dt{symbol} |
Delete from the current cursor position to the symbol |
Delete to |
Daw |
Delete the word where the cursor is located |
Delete all Word |
Dw |
Delete the cursor at the end of the word |
|
The d command above can be replaced with the C command, such as CAW, and then go directly into insert mode. |
|
,<c-w> Delete a word in insert mode,<c-u> deletes a row from the beginning of the cursor. |
|
|
|
|
5. Indent |
|
|
5>> |
The following 5 lines indent to the right |
> Delegate right,< to left |
The tab defined by indentation needs to be pre-set: Set sts=4 sw=4 et |
|
|
|
|
6. Visual mode (equivalent to mouse selected state) |
|
|
V |
Enter visual mode (character mode) |
|
V |
Enter visual mode (full line mode) |
|
CTRL + V |
Enter visual mode (block mode) |
|
Comment A section of code:<c-v>} I # <ESC> <ESC> |
|