Vim case conversion and chunk selection copy and paste

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.