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?

D. Ben Knoble
  • 26,070
  • 3
  • 29
  • 65
leeand00
  • 3,555
  • 5
  • 24
  • 40
  • Possibly duplicate of https://vi.stackexchange.com/questions/12513/save-a-macro-just-created-in-vimrc, although I think DBK's answer is better. – dedowsdi Nov 07 '19 at 06:10
  • @dedowsdi that doesnt seem like a dupe at all, though def related. – D. Ben Knoble Nov 07 '19 at 13:46
  • @D.BenKnoble read a macro into buffer and save a macro in vimrc are basically the same thing. – dedowsdi Nov 07 '19 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 07 '19 at 23:37

1 Answers1

4

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

"ap
:put a

Etc

D. Ben Knoble
  • 26,070
  • 3
  • 29
  • 65