Vi/vim jump to a specified line

Source: Internet
Author: User
(1) Press ESC, then 123GG jumps to 123 lines (2) Input: line number jump to the line you want! ###############################

Add, delete comments:

Note: Ctrl + V enters column-editing mode, moves the cursor down or up, marks the beginning of the line that needs comment, then presses the uppercase I, then inserts the comment, such as "//", and then presses ESC, which is all commented.

Delete: Press v First, enter visual mode, select the number of columns in the landscape (such as "//" comment symbol, need to select two columns), then press ESC, then press CTRL + V to enter the column editing mode, move the cursor down or up, select the comment section, and then press D to delete the annotation symbol.

Use the Replace command:

:%s/^/\/\//g to add//number comments at the beginning of the entire content
: 2,50s/^/\/\//g Add//Number comment at the beginning of 2~50
In turn, substitution is both a delete operation.

Vi/vim jump to a specified line

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.