New Alexandria
New Alexandria

Reputation: 7324

How do I jump to a non-alphabetical mark in vim?

when in normal mode, I can type m4 to mark a line.

but typing any of m0 though m9 jumps to files last closed, per the vim docs.

Are non-alphabetical marks a bug?
Can I jump to them, and how?

Upvotes: 0

Views: 133

Answers (1)

Dhruva Sagar
Dhruva Sagar

Reputation: 7307

If you read :h m you should see it's specified to work with m{a-zA-Z}. The m operator is used to define marks, however if you want to go to a mark location you should use '{a-zA-Z0-9}, so in order to jump to a numbered mark you should use that instead.

With regards to being able to define numbered marks manually, that can't be done, {0-9} are special marks that are set from the .viminfo file. Quoting from the docs :

Numbered marks '0 to '9 are quite different. They can not be set directly. They are only present when using a viminfo file |viminfo-file|. Basically '0 is the location of the cursor when you last exited Vim, '1 the last but one time, etc. Use the "r" flag in 'viminfo' to specify files for which no Numbered mark should be stored. See |viminfo-file-marks|.

Upvotes: 4

Related Questions