Daniel Nogradi wrote:
Hi vimmers!

I often find myself in need of copying (yanking) non-consecutive
multiple lines so that I can paste them somewhere else in a
consecutive way. Several lines are scattered around the file and would
like to collect them kind of.

At the moment I go to to first line, yank it, go to the destination
position, paste it, look for the second line, yank it, go to the
destination position, paste it after the already pasted line, etc.

Is it possible to yank a line (or character or block of text) and then
yank something else in a way that the second yanking does not
overwrite the previously yanked stuff but adds to it? So that a
subsequent paste would paste both?

Thanks for any help,
Daniel


When using a lettered register, "A means appending into "a ; AFAIK, other registers (such as the default register) don't support appending.

So, use e.g. "a3yy to yank 3 lines the first time (clearing the register), then e.g. "A2yy to append 2 lines to what you yanked previously. Or else, use ":let @a = ''" (without the double quotes) to clear, then "A with every yank.


Best regards,
Tony.

Reply via email to