Reference Document: http://blog.csdn.net/ii1245712564/article/details/46960387
First, comb the key knowledge for easy access
V (small v): Enter visualization
V (large V): Enter visual line
Ctrl + V: Entering a visual block
There are also some related operations that can be done
d
Delete selected text
c
Modify selected text
r
Replace selected text
I
Insert before text is selected
A
Insert after text is selected
gu
The selected area is converted to lowercase
gU
Select area to uppercase
g~
Case-Sensitivity intermodulation
>
Indent one unit to the right
<
Indent one unit to the left
Note: After the operation is complete, ' ESC ' ends the operation or exits the visualization
There are three modes in which you can enter a related command switch, for example:
V (Enter character visualization) ——— V or ESC (exit)
V (Enter character visualization) ——— V (enter line visualization)
What is visualization: Just select an area and then do something on it, and remember that, unlike normal operations, a visualization is an operation on an entire block of selected areas, and sometimes more efficiently.
For visual operations, there are three basic modes:
Character text manipulation (v): selecting text by character
Line this operation (V): Select text lines by row
Block text manipulation (Ctrl + V): Selecting text as a block
Main differences between three modes of selection text
Here's the cursor.
Perform operation ' V ', enter character text operation, select down
If you execute ' V ', enter the line text operation and select down
If you execute ' Ctrl + V ', enter the block text operation and select
You can also move left or right
Identification of three modes (see lower left corner)
A. Character visualization
B. Line visualization
C. Block visualization
To give a few more examples:
A. Comment out the entire file
Action: ctrl+v--Select target Block-----(uppercase)--#--esc
B. Replace (replace the first four lines of XXX with ABC)
C. Change the case ABC--ABC
Gu uppercase--lowercase
Gu lowercase--uppercase
Note: When selecting a block, O can change the extension direction
In general, sometimes it's a good idea to use visualizations.
The visualization of Vim