Cross-posting from Stackoverflow because I keep forgetting about this site...
Have a macro where a visually selected text will be made a markdown link and once the macro executes it leaves Vim in INSERT mode:
| - VISUAL selection i - cursor position in INSERT mode @l - invoke macro in "l" register Some |text| saying stuff. = @l => Some [text]() saying stuff. i
l holds the following:
:registers l Type Name Content c "l S]%a()^Ohq<80>kb
Created it the following way:
- Visually select some text
Sis a visual selection command in
^ - normal mode cursor position |text| =S]=> [text] ^
%(jump to closing bracket)
aand then type
- CTRL-O then
q(to finish the macro but to remain in INSERT mode)
So I selected this definition with the mouse (i.e.,
* register), and did
let @l = "S]%a()^Ohq<80>kb" in the other Vim instance, resulting in
Some |text| saying stuff. = @l => Some [text]()^Ohq<80>kb saying stuff. i
It works if Vim is built with clipboard support (
:let @+ = @l in one Vim instance, and
:let @l = @+ in another), but I would like to learn the fundamentals of deciphering these representations.
UPDATE: There is a slight difference between the Vim representations of the recorded & clipboard-copied macros and the ones that are pasted manually: the sequences
<80> are highlighted as special in the former case, but the string is shown with uniform color in the latter.
l is the original recorded macro,
+ is created by
:let @+ = @l, and
c content has been typed in verbatim:
Found a couple other Stackoverflow threads with a similar premise, but they weren't helpful:
Tried to convert the
<C-O> but it didn't work, and have no clue what
Based on the creation steps above, I would have expected something like
S]%a()^Oh^Oq instead of
No replies, and based on what I understood, it is not applicable in my case.
Chewed my way through the answers and comments, but no joy.