irongit

Find and execute tmux commands rather view a list with the ? key binding. A great way to memorize the keys.

tmux-fzf-keys/scripts/get_and_run.sh
16 lines407 BBourne Again Shell (bash)
1#!/usr/bin/env bash
2
3get_and_run() {
4 local selection=$(
5 tmux list-keys |
6 fzf --header=$'\nFuzzy trigger any tmux command\n to run | Esc to quit' \
7 --preview="echo {}" \
8 --border \
9 --preview-window=down:3:wrap
10 )
11 local command=$(echo $selection |
12 awk '{ $1=""; $2=""; $3=""; $4=""; print $0 }' |
13 sed 's/^ *//')
14 tmux run-shell "tmux $command"
15}
16get_and_run