Vim Batch Comment

Source: Internet
Author: User

Method One

Comments:

"Ctrl" + "V" enters the column editing mode, moves the cursor down or up, marks the beginning of the line to be annotated, then presses the uppercase I ("Shift" + "I"), and then inserts an annotation, such as "//", and then ESC, to annotate all.

Remove comments in bulk:

"Ctrl" + "V", enter the column editing mode, the number of horizontal selected columns (such as "//" annotation symbol, need to select two columns), and then press "D", will delete the comment symbol

Method Two

Use the following command to add comments at the beginning of the specified line:

: Starting line number, ending line number s/^/comment/g

Uncomment:

: Start line number, end line number s/^ comment //G

Example:

Add//comment on line 10-20

:ten, 50s#^#//#g

Delete//comment on line 10-20

:ten, 20s#^//# #g

Vim Batch Comment

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.