Vim: text editing tool
Vi is currently used, relatively powerful
Vim has three modes
Different modes have different functions.
Command mode-input mode input I key Conversion
Input mode-last line mode input: To last line
Use cursor movement in command mode
H, j, k, l
Delete operation
X cursor in one character at a time
D. delete a single dd in combination.
Ndd Delete row n
De deletes a word.
Dw deletes a word with spaces
10, 21 d Delete 10th rows to 21 rows
. Row where the current cursor is located
. 8 is to delete from the row where the cursor is located to 8th rows.
Copy and paste
Y Replication
Yy copy a row
Copy 3 rows in 3yy
P Paste
You can use u to cancel an error once in lower case.
Capital u undo all operations at a time
Ctrl + r undo
R single character replacement
. Repeat the previous operation
Visual mode: v V
Move text: d, p
This article is from the "Xu Shuai" blog