1) insert function (that is, insert one or several characters in a column of several rows)
Step 1: move the cursor to the specified position of the row to be inserted.
Step 2: press Ctrl + V to enter the visual block mode.
Step 3: move the cursor to the specified position of the last inserted row (by J or input row number + G)
Step 4: Shift + I to enter the insert mode
Step 5: Enter the characters you want to enter. After that, press the "ESC" key twice to view the expected results.
2) Deletion
Same as step 1 ~ Step 3
Step 4: Press D.
Step 5: Same as step 5
3) Replace
Press R with the same name, and enter the characters to replace.
4) Modification Operation
Press C as the same as above, and then enter the characters to modify.
For other VI operations, refer to the following link:
Http://edyfox.codecarver.org/html/vim_edit_tips.html
1. Exchange two characters
XP
2. Change the upper and lower lines
DDP
3. Merge the upper and lower rows
J
4. Delete all rows
DG
5. delete from the current position to the end of the row
D $
6. copy from the current position to the end of the row
Y $ can be pasted to another place.
Move, copy, and delete multiple rows
: N1, N2 M N3 move the n1-n2 line (including N1, N2) to below the N3 line;
: N1, N2 Co N3 copy the n1-n2 line (including N1, N2) to below N3 line;
: N1, N2 D Delete n1-n2 rows (including N1, N2;