Vim Learning Note I, Mark (Mark)
We can mark the text so that it is easy to jump between different locations in the document.
Create tags
Moves the cursor to a line and marks it with a ma
command. Where m
is the tag command, anda is the name of the tag being made.
You can use either the lowercase letter A-Z or the uppercase letter A-Z as the tag name. A small letter tag that is used only for the current buffer, while the uppercase letters are marked to span different buffers.
For example, you are editing File1, but you can still use the ‘A
command to move to the mark a created in File2.
Jump Markers
After you create a tag, you can use the ‘a
command to move to the first non-empty character of the specified line of markup. Here ‘
is the single quotation mark. You can also use the `a
command to move to the cursor position when you make a marker. Here `
is the inverted quotation mark (the one on the left of the number key 1).
Listing Tags
With :marks
commands, you can list all tags. This also includes some special tags built into the system (special marks):
. |
Recently edited locations |
0-9 |
Recently Used files |
∧ |
Recently inserted position |
‘ |
The position before the last jump |
" |
Location of the last time the file was exited |
[ |
At the beginning of the last modification |
] |
At the end of the last modification |
Delete Tag
If you delete a marked line of text, the markup is not saved. Not only can we use tags to move quickly, but we can also use tags to delete text, such as marking a line and ma
then using d‘a
it to erase the line.
Of course, we can also use the y‘a
command to copy this line.
With :delmarks a b c
a command, you can delete one or more tags, and the :delmarks!
command deletes all tags.
With :help mark-motions
commands, you can view more help information about the tag.
Command summary
m |
Create tags |
‘ |
Move to the beginning of a marked text |
` |
Move to the cursor position of the marker |
:marks |
Listing all tags |
:delmarks |
Delete the specified tag |
:delmarks! |
Remove All Tags
|
[1]. Vim Learning note mark (Mark) http://itindex.net/detail/5448-vim-%E5%AD%A6%E4%B9%A0-%E7%AC%94%E8%AE%B0
Vim Learning Notes