Comment by groovy2shoes

10 years ago

Yup, you can put buffer locations in registers in Vim, but they're in a separate "namespace" from the yank registers. They're normally called "marks" (as in bookmarks) in Vim parlance.

    "[a-zA-Z0-9\-"][ypd]{,2}       -- Quote to specify a register,
                                      followed by an alphanumeric
                                      character (or hyphen, or double
                                      quote (the default register))
                                      followed by a yank, put, or
                                      delete command.
    m[a-zA-Z\[\]<>]                -- Set the mark indicated by the
                                      following character.  Lower-case
                                      characters are buffer-local,
                                      upper-case are global across
                                      all buffers in the session.
                                      [, ], <, and > are normally
                                      implicit marks: [] refer to
                                      the start and end of the last
                                      effected range of text, while <>
                                      refer to the start and end of
                                      the visual selection (if any).
    '[a-zA-Z0-9<>'`"^\.(){}]       -- Jump to the mark indicated by
                                      the following character. Numeric
                                      marks are set in the .viminfo
                                      file, while the special
                                      characters refer to various
                                      implicit marks, which I won't
                                      list here since there's so many.

As in Emacs, I tend to think of it as a mark of advanced usage (but one among many, really). Navigating around in Vim is exquisite once you grok using marks. Vi had registers and marks as well, but marks were limited to buffer-local only, if I recall correctly.

This reminds me -- I need to get back into Emacs and learn some more! Hopefully this time I don't get carried away writing Lisp all night again ;) Makes me yearn for a Vim that's configurable and extensible with Lisp (there's a plugin that enables writing extensions in Racket, but I'm not sure how much extensibility it actually affords compared to Vimscript -- my guess is that it's probably rather limited, I'm afraid).