Switch to any TMUX pane, in any session, by searching and filtering using fzf.
Search and filter on any pane details, such as (but not limited to) the #{window_name}
, #{pane_title}
, or #{pane_current_command}"
. If a pane cannot be found using the search criteria, the plugin will offer to create a new window in the current session.
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.
To get the border styling as shown in the image above, you need fzf version >= 0.58.0.
-
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 prefix + 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 pane_id session_name window_name pane_title pane_current_command
.
Note: You can use any tmux FORMAT option allowed here. String manipulation should also work. For example, the pane_id
by default is shown with a leading percent symbol (e.g. %3
). You can remove this by setting set -g @fzf_pane_switch_list-panes-format "s/%//:pane_id session_name window_name pane_title pane_current_command"
- Terminal is Ghostty
- TMUX theme is catppuccin
- ZSH shell prompt is starship
ls
output in pane is eza
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.