Reference: http://xw2423.byr.edu.cn/blog/archives/232
Http://www.pythonclub.org/linux/vim/visual-mode
Vim's multiline editing skills are all in "visual mode.
You can enter visual mode in three ways:
1. V select by byte
2. V select by line
3. Press Ctrl + V to select a rectangle
The selected file can be used as a "Text object" for overall operations
Simple and clear operations are as follows:
1. d Delete this text object
2. y copy this text object
Case Sensitive operations
1 .~ Switch case sensitivity
2. Change all u capital
3. u all smaller write
Insert a Text object before or after it
This is a classic multi-row operation scenario.
1. I insert a Text object before each line
2. A is inserted after each line of "Text object"
3. c rewrite each line of "Text object" to a new content
This multi-row insertion is effective only for "text objects" that are vertically aligned on both sides, and the operation is completed by pressing ESC to return to normal mode.
Indent forward and backward
1.> indent advances
2. <indent retreat
Run the command: Set shiftwidth = n to set the progressive quantity of indent.
Multiple rows and one row
1. J. merge all rows of the Text object into one row.