preservim / vimux

easily interact with tmux from vim
MIT License
2.19k stars 158 forks source link

VimuxRunnerQuery with VimuxRunnerName with panes #226

Closed kourylape closed 2 months ago

kourylape commented 2 months ago

The docs for VimuxRunnerName calls out:

Set this option to define a query to use for looking up an existing runner pane or window when initiating Vimux. Uses the tmux syntax for the target-pane and target-window command arguments. (See the man page for tmux).

Tmux's doc for target-pane:

target-pane (or src-pane or dst-pane) may be a pane ID or takes a similar form to target-window but with the optional addition of a period followed by a pane index or pane ID, for example: ‘mysession:mywindow.1’. If the pane index is omitted, the currently active pane in the specified window is used.

Example Config:

vim.g.VimuxRunnerType = "pane"
vim.g.VimuxRunnerName = "vimuxout"
vim.g.VimuxRunnerQuery = {
    pane = "vimuxout", 
}

I know that's an invalid query, but it's not really called out without Tmux doc diving.

That config does update the pane's title to be vimuxout, but with https://github.com/preservim/vimux/blob/master/plugin/vimux.vim#L246. It's never going to work as a query.

It seems like there are two options:

kourylape commented 2 months ago

Sorry for the confusion. It seems my desired behavior can be had with the following config and excluding VimuxRunnerQuery all together:

vim.g.VimuxRunnerType = "pane"
vim.g.VimuxRunnerName = "vimuxout"

I do think the docs are little vague with how these options interact with each other. I had to figure it out by diving into the plugin's source.

alerque commented 2 months ago

I'm glad you figured it out. And clarifications to the docs are always welcome!