several commands in the [VIM] Visual mode
Vim's visual mode allows us to select a text area and manipulate it. Vim has three visual modes for manipulating character text, line text, and block text, respectively. in Visual mode, many common-mode commands also perform the same function. Just moving the cursor in the visual mode changes the bounds of the highlighted selection.
1. Enter Visual mode
Command |
Use |
V |
Enter a character-oriented visual mode |
V
|
Go to line-oriented visual mode |
Ctrl + V
|
Enter visual mode for column-oriented blocks |
Gv
|
Re-election of the last highlighted constituency |
2. Switch between visual modes
Command |
Use |
Esc
|
Back to Normal mode |
Ctrl + [
|
Back to Normal mode |
v/v/Ctrl + V
|
In the corresponding mode will switch to normal mode, That is, the same command is performed two times in normal mode or normal mode. |
V
|
Toggles into a character-oriented visual mode in a pattern that does not correspond |
V
|
Switch into line-oriented visual mode in a pattern that does not correspond |
Ctrl + V
|
Toggles into the visual mode of a column-oriented block in a pattern that does not correspond |
3. Toggle active end of highlighted selection
The range of highlighted selections is defined by its two endpoints. One end is fixed, and the other end is free to move with the cursor. You can toggle the active endpoint with the letter O to adjust the start position of the selection.
Command |
Use |
O |
Toggle the active end of the highlighted selection, |
4. Repeat line-oriented visual commands
Command |
Use |
. |
After performing an operation in row visual mode, executing this command will cause the same range of lines of text to be re-elected and perform the same action |
V J > . |
Enter the line-oriented visual mode, then use J to adjust the line bounds, execute the command indent command > Perform in normal mode again. The visible row that you just selected is repeated and indents are performed. It is advisable to use operator commands, not visual commands, whenever possible |
5. From visual mode to insert mode
In visual mode, the I and a keys are used as part of the object, pressing I or a does not enter into the insert mode. You have to enter the insert mode with the I and a keys.
6. Reference: "Practical Vim"