This plugin is like the brokenricefilms/tmux-fzf-session-switch TPM plugin, but it's for pane switching. Switch to any pane, in any session.
I use tmux sessions with many panes open, and I wanted a way of using fzf to switch to a pane quickly by filtering on the #{window_name}
, #{pane_title}
, or #{pane_current_command}"
. If a pane cannot be found using the search criteria, it'll offer to create a new pane in the current session.
-
Install TPM.
-
Add the plugin to your
tmux.conf
file.set -g @plugin 'kristijan/tmux-fzf-pane-switch'
-
Start tmux and install plugin.
Press
prefix + I
(capital i, as in Install) to fetch the plugin.Press
prefix + U
(capital u, as in Update) to update the plugin.
You can override the following options in your tmux.conf
file.
set -g @fzf_pane_switch_bind-key "key binding"
Default is s
, which replaces the tmux default session select (tmux default: choose-tree -Zs -O name
)
set -g @fzf_pane_switch_window-position "position"
Default is center,70%,80%
. You can use any options allowed here.
set -g @fzf_pane_switch_preview-pane "[true|false]"
Default is true
Only when @fzf_pane_switch_preview-pane
is true
.
set -g @fzf_pane_switch_preview-pane-position "position"
Default is right,,,nowrap
. You can use any options allowed here.
This is the output format of tmux list-panes
that you see in the fzf window. You can use this to match on other tmux formats.
set -g @fzf_pane_switch_list-panes-format "FORMATS"
Default is session_name window_name pane_title pane_current_command
.
Note: The list-panes
format will always start with pane_id
as that what's passed into switch-client
to allow switching on matched panes. You can use any tmux FORMAT options allowed here.
The demo video was captured using asciinema.
-
TMUX theme is catppuccin (didn't render all that well in asciinema, but it's great!)
-
ZSH shell prompt is starship
-
Some of the content in the active panes:
- neofetch
curl wttr.in
I pretty much retrofitted the brokenricefilms/tmux-fzf-session-switch TPM plugin. So, if you're looking for something to switch tmux sessions only, go check it out.