On 07/04/09 16:35, fREW Schmidt wrote:
[Tony wrote]
>     Hm, what happens if you use one of the following {rhs}es in a
>     Normal-mode mapping? Then you wouldn't need to copy the ex-command
>     register contents except when you really need it.
>
>             :exe @:<CR>
>     or
>             :let @@ = @: <Bar> exe @@<CR>
>     or
>             :let @@ = @: <Bar> normal @"<CR>
>
>     Notes:
>     1. I'm clobbering the unnamed register as the one least likely to hold
>     "valuable permanent data".
>     2. The above is for use in a mapping. To try it directly at the
>     command-line, use | instead of <Bar> and hit the Enter key (to execute
>     the ex-command) instead of <CR>.
>
[fREW Schmidt answered]
>
> This is close! The first choice works once:
>
> :let @@ = @: <Bar> exe @@<CR>
>
> But then of course @: has changed so I have to do exe @@.  I can live
> with that for now, but I'd still prefer that the @@ actually included a
> ; and a <CR> so that I can just do @@ instead of ;exe @@<CR>.  Of course
> I'll do it with a mapping, but hopefully I won't have to do that forever
> and I'd like to do this the real vim way.
>
> Thanks again for your help Tony!  I'll make mappings now.

You ought to be able to repeat it with @" once the ":let" statement has 
been executed once. However, this (both @@ and @") is the unnamed 
register, if you use a yank or a delete it will be overwritten; so for 
repeat use a named register might be better, @z maybe.


Best regards,
Tony.
-- 
The brain is a wonderful organ; it starts working the moment you get up
in the morning, and does not stop until you get to school.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to