Transferred from: http://www.cnblogs.com/fortran/archive/2010/07/25/1784513.html
The command of the case conversion in Vim is: Gu or Gu, the image of a little u means to lowercase, big u means to capitalize. The next step is to define the two commands (qualifying lines, letters, words) and so on.
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. 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 you want to convert, type: 1gU
Lowercase to uppercase conversions from the line down 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
Capitalization conversion in Vim