Hello I like vim but their seems to be a limited macro system from what I understand. The documentation I have says to specify a letter to define the macro. Does this mean that I a restricted to the letters In the alphabet for macros?

  • 2
    can you give an example? the macro name must be from a-z but the contents are unrestricted by alphabet
    – Mass
    Sep 26 '21 at 22:58
  • 1
    Also, mappings are less restricted in name if you need more
    – D. Ben Knoble
    Sep 27 '21 at 11:20

That's correct, macro names are limited to a-z. Macros are stored in the named registers a-z, so a macro might be overwritten if you yank to a register a-z that currently holds a macro.

If you are hitting the limits of what can easily done by a macro, then other options are:

  • custom mappings (:help :map)
  • calling custom Vimscript functions (:help :function)
  • new commands (:help :command)

My experience is that writing a function offers much more flexibility and power than a macro. Once your function is nice, then you can define a mapping or command to call the function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.