Sunday, June 11, 2017

Re: save and load a micro

On Sunday, June 11, 2017 at 5:26:43 AM UTC-5, Sand Glass wrote:
> And record a macro in register a. But the macro not completely right like ^Q(it's into block coloumn mode). I want to fix my macro and save it to a file, next time I open a file can load the macro to a reg.
> The question is I don't how to fix my macro and load it to a reg next time.

By default, it should be saved already, in your .viminfo file. Check your 'viminfo' setting to make sure if you are worried.

You can also paste the contents of your register into a file with this normal-mode command:

"ap

Then you can save that file if you like. To get your macro back, just yank the content back into a register:

0"ay$

This may not work in all cases for special characters in the register, etc. The .viminfo method is probably more robust.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment