Tuesday, September 10, 2013

Re: appending more text to a macro definition

On Tuesday, September 10, 2013 12:02:45 PM UTC-5, Nnaemeka David wrote:
> How do I append more text to a recorded macro?

I assume you're talking about recording macros with the 'q' command in normal mode, for example:

qqAhello!<Esc>q to record a macro in register 'q' that puts "hello!" at the end of a line.

To append more commands to the same macro, just record into the same register, but use a capital letter. This is documented at :help q

Continuing our example,

qQi world<Esc>q

will modify the macro in 'q' to instead write "hello world!" at the end of the line.

> the macro contains only one line but when the text is appended, or commands, the macro will extend to three lines.

You've lost me now, however. How did you append text to the macro, if not using the capital letter as I detail above? What do you mean by "lines" in the recorded macro?

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