preservim/vimux

VimuxRunnerQuery with VimuxRunnerName with panes

kourylape opened this issue · 2 comments

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:

  • Update the help doc for VimuxRunnerName to call out it works for panes, but can't be queried.
  • Utilize list-panes -aF '#{pane_index}:#{pane_title}' similar to nearestRunnerId(). I think the challenge would be you would to distinguish between a query that's {right-of} versus vimux versus 0

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.

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