Jürgen Krämer wrote:
>>    :'<,'>g/^/norm @z
>>
>> (assuming your macro was in register "z")
> 
> no need to use :global,
> 
>   :'<,'>normal @z
> 
> works, too.

I've had just enough trouble forgetting which Ex commands (mostly 
the ones I don't use regularly) accept a range and which default 
to the first or last line of that range.  So I tend to toss in 
the extra "g/^/" guard to make sure the operation is happening on 
each line rather than guess wrong and have to undo+rerun the 
command.  ":exec" and ":put" are the big ones I guess that 
regularly get me (or rather "got" me...before I started using the 
:g form).  ":norm" lumps in my head with ":exec", but on reading 
the docs (and Jurgen's evidence) ":norm" takes a range, and 
":exec" balks at it.

-tim




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

Reply via email to