On Wed, May 11, 2011 at 10:39 PM, Taylor Hedberg tmhedb...@gmail.com wrote:
[snip]
Note that if there's already something in register a, it won't
automatically be cleared before your global command executes, so you'll
probably want to clear it first with:
:let @a =
I personally use
I often use :g/pattern/d to delete select lines. But I just realized that
I don't know how to retrieve all of those lines after performing this command.
If I do a 'p' after this, I only get the last line that was deleted. How can I
paste all of the lines that were deleted?
Thanks,
Bill
Reply to message «Cut-and-Paste with :g/pattern/d»,
sent 20:51:36 11 May 2011, Wednesday
by Waters, Bill:
qaq:g/pattern/d A
First normal-mode command empties the `a' register, then «d A» will append
lines
to register a (note the case).
Pure ex-mode version for use in scripts:
:let
On May 11, 2011 at 11:51 AM -0500, Waters, Bill wrote:
I often use :g/pattern/d to delete select lines. But I just
realized that I don't know how to retrieve all of those lines after
performing this command. If I do a 'p' after this, I only get the last
line that was deleted. How can I
You can delete into a named register (rather than the default register)
and append, rather than replace, its contents. For registers a-z,
specifying them as A-Z (uppercase), means to append to the existing
register contents. So the following:
:g/pattern/d A
would append each deleted line to
: Wednesday, May 11, 2011 12:09 PM
To: vim_use@googlegroups.com
Subject: Re: Cut-and-Paste with :g/pattern/d
You can delete into a named register (rather than the default register)
and append, rather than replace, its contents. For registers a-z,
specifying them as A-Z (uppercase), means to append
On May 11, 2011 at 11:51 AM -0500, Waters, Bill wrote:
I often use :g/pattern/d to delete select lines. But I just
realized that I don't know how to retrieve all of those lines after
performing this command. If I do a 'p' after this, I only get the last
line that was deleted. How can I