Wednesday, February 26, 2014

Re: How to edit a macro?

On 10:52 Tue 25 Feb , Asis Hallab wrote:
> Dear Vim experts,
>
> after recording a macro I realized that I forgot to specify the
> register I yanked into.
>
> The macro in register q was
>
> /^[^#].*<-.*GO:\d\{7\}^My/)^M
>
> and matches lines like the following line 1
> 1 light <- c( 'GO:1234567',
> 2 'GO:7162635', 'GO:4536271',
> 3 'GO:7654321' )
>
> the macro yanks everything up to, and including, line 3.
>
> The problem is, that I want to specify the register the content is yanked to.
> So I tried
>
> :let @q='/^[^#].*<-.*GO:\d\{7\}^M"Gy/)^M'
>
> But the ^M form a problem. The macro is not executed correctly.
>
> Does anyone know how to solve this?
>
> Cheers!

You can dump the macro with:
^r^r"q (in the insert mode see :h i^r^r)
then you can edit it and yank back to register q.

Best regards,
Marcin

--
--
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/groups/opt_out.

No comments: