-
-
Save nalakawula/bc381453d8dbe725934630fb969fb31f to your computer and use it in GitHub Desktop.
tmux and fzf: fuzzy tmux session/window/pane switcher (this version uses tmux new popup window)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# customizable | |
LIST_DATA="#{window_name} #{pane_title} #{pane_current_path} #{pane_current_command}" | |
FZF_COMMAND="fzf-tmux -p --delimiter=: --with-nth 4 --color=hl:2" | |
# do not change | |
TARGET_SPEC="#{session_name}:#{window_id}:#{pane_id}:" | |
# select pane | |
LINE=$(tmux list-panes -a -F "$TARGET_SPEC $LIST_DATA" | $FZF_COMMAND) || exit 0 | |
# split the result | |
args=(${LINE//:/ }) | |
# activate session/window/pane | |
tmux select-pane -t ${args[2]} && tmux select-window -t ${args[1]} && tmux switch-client -t ${args[0]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind-key ` run-shell -b tmux-switch-pane.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment