Vim multi-row operations

Source: Internet
Author: User
Vim multi-row operations & lt; ESC & gt; and then press v to enter visual mode. & Lt; ESC & gt; press CTRL + V to enter the visualblock mode (Column editing ). Uniform indentation of multiple lines of text: use sw to set the indentation (number of spaces). For example, 1 setsw = 4 to enter visual mode. select the text and use & lt; to reduce indentation, & gt; added the vim multi-row operation. Then press v to enter visual mode. Press CTRL + V to enter the visual block mode (Column editing ). Uniform indentation of multiple lines of text: use sw to set the indentation (number of spaces). For example, 1 set sw = 4 to enter visual mode. select the text and use "<" to reduce indentation, ">" adds indentation, which is very convenient. It is also convenient to copy text in visual mode. Add characters to the beginning of a line. for example, add #: Move the cursor to the beginning of a line, enter visual block mode, select a line from the up or down key, press I (uppercase letters of I), and enter ##, then press In this way, # is added to the beginning of multiple rows. You can also add fixed characters at fixed positions of multiple rows. If you want to delete these ##, enter the visual block mode, select these ##, and press d. Run the following command to add ##: 1: % s/^/#/g to the beginning of all rows ):, 6 s/^/\ &/g remove 2 ~ &:, 6 s/^ &/g

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.