Skip to content

A tmux plugin that uses fzf to switch to a pane in any session.

License

Notifications You must be signed in to change notification settings

Kristijan/tmux-fzf-pane-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tmux-fzf-pane-switch

asciicast

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.

Requirements

  • fzf >= 0.53.0 (requires the --tmux option). I tested with 0.55.0.
  • tmux >= 3.3. I tested with 3.3a.

Installation

  1. Install TPM.

  2. Add the plugin to your tmux.conf file.

    set -g @plugin 'kristijan/tmux-fzf-pane-switch'
  3. 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.

Customise

You can override the following options in your tmux.conf file.

Key binding

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)

fzf window position

set -g @fzf_pane_switch_window-position "position"

Default is center,70%,80%. You can use any options allowed here.

fzf pane preview

set -g @fzf_pane_switch_preview-pane "[true|false]"

Default is true

fzf pane preview position

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.

tmux list-panes format

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.

Demo Configuration

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:

Acknowledgments

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.

About

A tmux plugin that uses fzf to switch to a pane in any session.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages