Vim MARK: Mark

Source: Internet
Author: User

When editing with vim, you often needCodeFor example, indent, delete, and copy. For example, if you use the YY command, you need to calculate the number of rows, which is inconvenient. If you can mark the position, the code of a large segment can be marked by the front and back positions. This makes it much easier.

Vim mark is the best solution. Mark is a position, including the row number and column number. To mark a location, use M [A-Za-Z. This means you can mark up to 72 locations. But we usually don't use that much. Lowercase indicates the position in the current file, while uppercase indicates the position in all the buffers (Files) currently opened by VIM. In the application scenarios listed in this article, lowercase letters are enough.

After marking a position, we can jump to this position. The command is 'a, and the front is a back quotation mark. This command redirects the cursor to the row number and column number of the position. If you only want to jump to the front of the row, you can use 'a. The front is a single quotation mark. After marking a location, for example, if you already have two locations A and B, you can use: 'a, 'B' d to delete all rows between 'a and 'B.

To list all tags, use: Mark. In addition to user-defined, VIM also provides a predefined location, such as 'and '', that is, single quotation marks and double quotation marks, and [and. You can use Mark to list all these items.

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.