If I want to copy lines 17-19 to line 33, I can do this in one command like this:
:17,19t33
Is there an equivalent way of doing this if the destination is another open Vim buffer? For example, if I wanted to copy lines 17,19 of the current buffer into buffer #2, is there a way to do this without yanking the text, switching buffers and pasting?
Note that I typically have the source and destination files open in a split.
Does chaining counts as a one-liner? E.g.:
:17,19y | b# | 33put | b#
Not sophisticated, but should do it. I used b#
for convenience.
Kudos to Peter for pointing out a mistake I made -- I moved that initial buffer switch to the end.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With