If I have a buffer's name + number (it might even be hidden), how do I send a command to it while keeping the focus on my active buffer?
Begin your edit session with the command: vi file1 file2<CR> to yank the five lines into the buffer named a.
To copy text into a buffer, use the vi yank command. The most common uses are outlined below. The vi yy command "yanks" the current line into the vi general buffer. That is, it copies the line for you to put into the file immediately.
Command buffers are the unit of work submission in Metal; they are created by the CPU and executed by the GPU. This relationship allows you to balance CPU and GPU work by adjusting the number of command buffers submitted per frame.
To copy text, place the cursor in the desired location and press the y key followed by the movement command. Below are some helpful yanking commands: yy - Yank (copy) the current line, including the newline character. 3yy - Yank (copy) three lines, starting from the line where the cursor is positioned.
You can't; instead, that hidden buffer must be (temporarily) activated in order to execute commands on it.
(The only exceptions are the getbufline()
and get/setbufvar()
functions, but you can't do much with them.)
My ingo-library plugin provides a handy ingo#buffer#visible#Execute( bufnr, command )
function that handles that for you.
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