Vim visual mode

Source: Internet
Author: User

Reference: http://xw2423.byr.edu.cn/blog/archives/232

Http://www.pythonclub.org/linux/vim/visual-mode

 

Vim's multiline editing skills are all in "visual mode.

 

You can enter visual mode in three ways:

1. V select by byte

2. V select by line

3. Press Ctrl + V to select a rectangle

 

The selected file can be used as a "Text object" for overall operations

Simple and clear operations are as follows:

1. d Delete this text object

2. y copy this text object

 

 

Case Sensitive operations

1 .~ Switch case sensitivity

2. Change all u capital

3. u all smaller write

 

Insert a Text object before or after it

This is a classic multi-row operation scenario.

1. I insert a Text object before each line

2. A is inserted after each line of "Text object"

3. c rewrite each line of "Text object" to a new content

 

This multi-row insertion is effective only for "text objects" that are vertically aligned on both sides, and the operation is completed by pressing ESC to return to normal mode.

 

Indent forward and backward

1.> indent advances

2. <indent retreat

 

Run the command: Set shiftwidth = n to set the progressive quantity of indent.

 

Multiple rows and one row

1. J. merge all rows of the Text object into one row.

 

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.