yanking lines from a buffer that isn't the active one

vim

Solution

:let @0 = join(getbufline('#', 42), "\n") . "\n"

(Replace `#` with the name of the other buffer and `42` with the line number within the other buffer.)

Problem

Let's say there are two loaded buffers/files and they are both displayed via split windows, line numbers are enabled and thus known. Is there a way to stay in one buffer, specify a line of the other buffer and yank it so it can be put into the active buffer?

Original source