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)