Vim: copy text by buffers in one command

If I want to copy lines 17-19 to line 33, I can do this in one command as follows:

:17,19t33 

Is there an equivalent way to do this if the destination is another open Vim buffer? For example, if I wanted to copy lines 17.19 of the current buffer to buffer # 2, is there a way to do this without soaking the text, rearranging the buffers and pasting?

Please note that I usually have the source and target files open in a split.

+7
vim
source share
1 answer

Does the chain count as single line? For example:.

 :17,19y | b# | 33put | b# 

Not complicated, but must do it. I used b# for convenience.

Kudos to Peter for pointing out an error, I moved this initial buffer switch to the end.

+4
source share

All Articles