On 02/12/2011 10:01 AM, Scott Steele wrote:
      q a A " # Great line!<ESC>" j q 4 @ a
(i.e. I create a macro that edits a line and moves to the next line,
and then I tell the macro to run 4 more times.)

But if I really don't want to create a macro and have to call it, is
there something like lambda for macros? I'm thinking that I'm looking
for a specific key. Referring to that key as<THE-KEY>, this is how
I'd like to be able to edit those 5 lines:
     5<THE-KEY>  A " # Great line<ESC>" j<THE-KEY>

While it's really ugly, you can execute the expression-register as a macro, so you can do something like

  5@="A # Great line!^[j"

(entering the escape as control+V followed by <esc> to get what appears to be the "^[" in my above) followed by <enter>.

So while it does allow for what you describe (the first <THE-KEY> is "@=" (mappable to a single key) and the terminating <THE-KEY> would be <enter>), the overhead (both mental and physical) of escaping control-characters, makes it pretty useless to me. When I reach for macros (rarely outside the context of vimgolf) I tend to do as the others have replied, recording to either the "q" or "a" register as my default.

-tim



--
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

Reply via email to