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

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tmux-fzf-pane-switch

Screenshot of the fzf window listing all tmux panes for selection and switching.

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.

Requirements

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

To get the border styling as shown in the image above, you need fzf version >= 0.58.0.

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 prefix + 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 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"

Tools used in image

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