Skip to content

cparadis6191/fzf-tmux.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 

Repository files navigation

fzf-tmux.sh

bash, zsh, and fish key bindings for tmux objects, powered by fzf.

Each binding will allow you to browse through tmux objects of a certain type, and select the objects you want to paste to your command-line.

Installation

  • Install the latest version of fzf
  • Update your shell configuration file

Usage

List of bindings

  • CTRL-X? to show this list
  • CTRL-XCTRL-F to Find tmux pane words
  • CTRL-XCTRL-L for tmux pane Lines

Warning

If zsh's KEYTIMEOUT is too small (e.g. 1), you may not be able to hit two keys in time.

Inside fzf

  • TAB or SHIFT-TAB to select multiple objects
  • CTRL-/ to change preview window layout

Customization

# Redefine this function to change the options
_fzf_tmux_fzf() {
  fzf --height 50% --tmux 90%,70% \
    --layout reverse --multi --min-height 20+ --border \
    --no-separator --header-border horizontal \
    --border-label-pos 2 \
    --color 'label:blue' \
    --preview-window 'right,50%' --preview-border line \
    --bind 'ctrl-/:change-preview-window(down,50%|hidden|)' "$@"
}

Alternatively, set the $FZF_TMUX_DEFAULT_OPTS environment variable to change options. Note that this is the only way to change options in fish.

Defining shortcut commands

Each binding is backed by _fzf_tmux_* function so you can do something like this in your shell configuration file.

tl() {
  _fzf_tmux_fpane_words
}

tw() {
  cd "$(_fzf_tmux_lpane_lines)"
}

In fish, each binding is backed by _fzf_tmux_* so you can do something like this this in your shell configuration file.

function tw
  _fzf_tmux_fpane_words
end

function tsl
  cd (_fzf_tmux_lpane_lines)
end

Environment Variables

Variable Description Default
BAT_STYLE Specifies the style for displaying files using bat full
FZF_TMUX_DEFAULT_OPTS Specifies the default options for _fzf_tmux_fzf

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages