A text selection:
Rectangular block Selection:
[Ctrl]+v block selection, can be selected in a rectangular way
V character selection, the cursor will pass through the place of the white selection!
V (uppercase) line selection, the line of the cursor will be reversed white selection!
Select the command line mode to use d Delete, y copy, move the cursor to another place, in the command line mode with p pasted below the cursor, p pasted above the cursor.
The command for case conversion in two Vim is
Gu or Gu
The explanation of the image is that small u means lowercase; big u means capitalization.
1, whole article capitalization converted to lowercase
When you open a file, you do not need to enter command line mode. Type: Gggug
explain: Gggug divided into three sections gg gu G
gg= cursor to the first character of the file
Gu= the selected range all lowercase
g= to end of file
2, the whole article lowercase converted to uppercase
When you open a file, you do not need to enter command line mode. Type: Gggug
explain: Gggug divided into three sections GG GU G
gg= cursor to the first character of the file
gu= all uppercase in the selected range
g= to end of file
3. Convert only one word
Guw, GUE
GUW, GUE
The words that follow the cursor are then converted to uppercase and lowercase.
The command to convert 5 words is as follows:
gu5w, gu5e
gu5w, gu5e
4, convert the case of a few lines
Position the cursor on the line that you want to convert, type: 1gU lowercase to uppercase conversions from the line below the cursor
10gU, a 11-line lowercase to uppercase conversion
And so on, there are other uppercase and lowercase conversion commands
GU0: From the position of the cursor to the beginning of the line, it becomes uppercase
gu$: From the cursor position to the end of the line, it becomes uppercase
GUG: From the cursor position to the last character of the article, all uppercase
GU1G: From the position of the cursor to the first character of the story, it becomes uppercase
Three comprehensive applications
You can also make a case conversion after selecting any area:
[Ctrl]+v Select Area, refer to the upper case conversion command for any conversion.]
Reference: http://blog.csdn.net/guowake/article/details/2217086
Vim case conversion and chunk selection copy and paste