2

I know that you can use let @x = @w to copy the contents of a macro from one register to another, but how do you read the contents of your macro register into the buffer?

4
  • Possibly duplicate of vi.stackexchange.com/questions/12513/…, although I think DBK's answer is better.
    – dedowsdi
    Nov 7, 2019 at 6:10
  • @dedowsdi that doesnt seem like a dupe at all, though def related.
    – D. Ben Knoble
    Nov 7, 2019 at 13:46
  • @D.BenKnoble read a macro into buffer and save a macro in vimrc are basically the same thing.
    – dedowsdi
    Nov 7, 2019 at 23:28
  • Disagree, maybe pedantically—one involves the let and the “saving,” whereas here we might just care about pasting. @dedowsdi but good to link them
    – D. Ben Knoble
    Nov 7, 2019 at 23:37

1 Answer 1

4

Macros are stored in the same registers as you use for yanking, deleting, and putting, so any of

"ap
:put a

Etc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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