How to send a command to a specific buffer?

If I have a buffer name + number (it may even be hidden), how can I send him a command while keeping focus on my active buffer?

+8
vim
source share
1 answer

You can not; instead, the hidden buffer must be (temporarily) activated to execute commands on it.

(The only exceptions are the getbufline() and get/setbufvar() functions, but you cannot handle them.)

My ingo-library plugin provides a convenient ingo#buffer#visible#Execute( bufnr, command ) function that handles this for you.

+5
source share

All Articles