Tuesday, October 8, 2013

Re: yanking non-contiguous lines?

>Assuming Vim without plugins like YankRing or the like, what is the
>fastest way to copy non-contiguous lines to another place in the
>document, such as a document:
>
>    AAA
>    BBB
>    CCC
>    DDD
>
>That I want to become
>
>  AAA
>  BBB
>  CCC
>  DDD
>
>  AAA
>  CCC
>  DDD
>
>Thanks!
>
>c
>--
>Chris Lott <chris@chrislott.org>

This is what I would do:

qaq to clear register a then go to every line you want and copy it with "Ayy (capital A for appending)
Eventually, I would use "ap to paste

Regards

Dimitar

No comments: