Detailed description of VIM mark

Source: Internet
Author: User

Vim allows you to place custom tags in the text. Run the "Ma" command to mark the current cursor position with. You can use 26 tags (A to Z) in the text ). These tags are invisible, but they are only remembered by VIM.
To jump to a tag you defined, run '{mark}. Here {mark} refers to the letter that defines the tag. Therefore, the command to move to mark a is:

'A

The command 'Mark (with a single quotation mark) moves to the beginning of the row where the mark is located. This is different from the 'mark command,
The latter is the column marked on the row where the tag is located.

It is useful when processing two related parts of a file. Assume that you need
View some content in the beginning of the text, first move to the beginning of the line, set a mark s (start ):

MS

Then, move to the location you want to process and set a tag e (end ):

Me

Now you can move it at will. When you need to look at the starting point, you can use this command to move it there:

'S

Then use ''to jump back. You can also use 'e to jump to the end of the text you are processing.
Here s and E are used as the mark names, which have no special meaning, just to remember.

You can use the following command to obtain the list of all tags:

: Marks

You will notice some special tags, including:

'Position before jump
"Last edited location
[Start of the last modified position
] End of the last modified position

Supplement: If you want to delete marks, run the delmarks + markname command.


(Original address:
Http://blog.163.com/lgh_2002/blog/static/44017526201081154512135)

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.