I've discovered I can execute vim macros from the command line using the following command:
vim myfile -c "argdo norm @aZZ"
This command executed from the command line will execute a macro that I have stored inside
register a and close the file. It works fine, however, I'd like to be able to execute a macro that I have as a string and not a macro that is already inside a register.
Let's say I see my macro using
:reg on vim, and inside the register
"a I see
Goa^Ma^Ma^C^C. If I manually copy
Goa^Ma^Ma^C^C to a different register with the command
:let @l="Goa^Ma^Ma^C^C", this macro will not work on the register
"l as it works on register
"a. Is there any way of copying the value of a macro to my clipboard and paste it on another register without breaking it? Just so I can execute macros that I've extracted from my registers on the command line?