Re: How to save a macro for later use?
- Hello Li
> I recorded a macro. I hope I can use it anytime I open Vim again. RightPut in your .vimrc file (if not already done)
> now, if I quit Vim, the recorded macro is gone. How can I save it for
> later use?
" save global variables that consists of upper case letters
" save 50 lines of each register
Then your macros should be saved and restored in the register you
recorded them, e.g. in register @a if you recorded it by entering
You can now save your macro in a global variable (consisting of
upper case letters, digits and '_' only). Let the macro reside in
register @a and MY_MACRO be the name of the global variable, then type: