irongit

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

initial commit

huncholanehuncholaneauthored
commit 3d81502fd0bba875327e458bd450fa8d27873652Browse files

4 files changed, +331 -0

+32-0README.md
@@ -0,0 +1,32 @@
1+# 🔥 tmux-fzf-keys
2+
3+Fuzzy-find and run **any tmux keybinding** — instantly.
4+Interactive, searchable, mode-aware. Turn your tmux into a command center. 🚀
5+
6+![demo](https://user-images.githubusercontent.com/your-demo.gif)
7+
8+---
9+
10+## ⚡ Features
11+
12+- 🧠 Fuzzy-search all keybindings across tables
13+- ⌨️ Run the command directly from the list
14+- 📋 Displays mode and command side-by-side
15+- 🪟 Opens popup automatically if interaction is detected (e.g. prompts)
16+- 🧩 Simple and clean plugin structure
17+
18+---
19+
20+## Prerequisites
21+
22+- [fzf](https://github.com/junegunn/fzf)
23+
24+## 🔧 Installation
25+
26+### Using TPM
27+
28+Add this to your `.tmux.conf`:
29+
30+```tmux
31+set -g @plugin 'yourname/tmux-fzf-keys'
32+```
+281-0sample.txt
@@ -0,0 +1,281 @@
1+bind-key -T copy-mode C-Space send-keys -X begin-selection
2+bind-key -T copy-mode C-a send-keys -X start-of-line
3+bind-key -T copy-mode C-b send-keys -X cursor-left
4+bind-key -T copy-mode C-c send-keys -X cancel
5+bind-key -T copy-mode C-e send-keys -X end-of-line
6+bind-key -T copy-mode C-f send-keys -X cursor-right
7+bind-key -T copy-mode C-g send-keys -X clear-selection
8+bind-key -T copy-mode C-k send-keys -X copy-end-of-line
9+bind-key -T copy-mode C-n send-keys -X cursor-down
10+bind-key -T copy-mode C-p send-keys -X cursor-up
11+bind-key -T copy-mode C-r command-prompt -i -I "#{pane_search_string}" -p "(search up)" "send -X search-backward-incremental \"%%%\""
12+bind-key -T copy-mode C-s command-prompt -i -I "#{pane_search_string}" -p "(search down)" "send -X search-forward-incremental \"%%%\""
13+bind-key -T copy-mode C-v send-keys -X page-down
14+bind-key -T copy-mode C-w send-keys -X copy-pipe-and-cancel
15+bind-key -T copy-mode Escape send-keys -X cancel
16+bind-key -T copy-mode Space send-keys -X page-down
17+bind-key -T copy-mode , send-keys -X jump-reverse
18+bind-key -T copy-mode \; send-keys -X jump-again
19+bind-key -T copy-mode F command-prompt -1 -p "(jump backward)" "send -X jump-backward \"%%%\""
20+bind-key -T copy-mode N send-keys -X search-reverse
21+bind-key -T copy-mode R send-keys -X rectangle-toggle
22+bind-key -T copy-mode T command-prompt -1 -p "(jump to backward)" "send -X jump-to-backward \"%%%\""
23+bind-key -T copy-mode X send-keys -X set-mark
24+bind-key -T copy-mode f command-prompt -1 -p "(jump forward)" "send -X jump-forward \"%%%\""
25+bind-key -T copy-mode g command-prompt -p "(goto line)" "send -X goto-line \"%%%\""
26+bind-key -T copy-mode n send-keys -X search-again
27+bind-key -T copy-mode q send-keys -X cancel
28+bind-key -T copy-mode r send-keys -X refresh-from-pane
29+bind-key -T copy-mode t command-prompt -1 -p "(jump to forward)" "send -X jump-to-forward \"%%%\""
30+bind-key -T copy-mode MouseDown1Pane select-pane
31+bind-key -T copy-mode MouseDrag1Pane select-pane \; send-keys -X begin-selection
32+bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
33+bind-key -T copy-mode WheelUpPane select-pane \; send-keys -X -N 5 scroll-up
34+bind-key -T copy-mode WheelDownPane select-pane \; send-keys -X -N 5 scroll-down
35+bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
36+bind-key -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
37+bind-key -T copy-mode Home send-keys -X start-of-line
38+bind-key -T copy-mode End send-keys -X end-of-line
39+bind-key -T copy-mode NPage send-keys -X page-down
40+bind-key -T copy-mode PPage send-keys -X page-up
41+bind-key -T copy-mode Up send-keys -X cursor-up
42+bind-key -T copy-mode Down send-keys -X cursor-down
43+bind-key -T copy-mode Left send-keys -X cursor-left
44+bind-key -T copy-mode Right send-keys -X cursor-right
45+bind-key -T copy-mode M-C-b send-keys -X previous-matching-bracket
46+bind-key -T copy-mode M-C-f send-keys -X next-matching-bracket
47+bind-key -T copy-mode M-1 command-prompt -N -I 1 -p (repeat) "send -N \"%%%\""
48+bind-key -T copy-mode M-2 command-prompt -N -I 2 -p (repeat) "send -N \"%%%\""
49+bind-key -T copy-mode M-3 command-prompt -N -I 3 -p (repeat) "send -N \"%%%\""
50+bind-key -T copy-mode M-4 command-prompt -N -I 4 -p (repeat) "send -N \"%%%\""
51+bind-key -T copy-mode M-5 command-prompt -N -I 5 -p (repeat) "send -N \"%%%\""
52+bind-key -T copy-mode M-6 command-prompt -N -I 6 -p (repeat) "send -N \"%%%\""
53+bind-key -T copy-mode M-7 command-prompt -N -I 7 -p (repeat) "send -N \"%%%\""
54+bind-key -T copy-mode M-8 command-prompt -N -I 8 -p (repeat) "send -N \"%%%\""
55+bind-key -T copy-mode M-9 command-prompt -N -I 9 -p (repeat) "send -N \"%%%\""
56+bind-key -T copy-mode M-< send-keys -X history-top
57+bind-key -T copy-mode M-> send-keys -X history-bottom
58+bind-key -T copy-mode M-R send-keys -X top-line
59+bind-key -T copy-mode M-b send-keys -X previous-word
60+bind-key -T copy-mode M-f send-keys -X next-word-end
61+bind-key -T copy-mode M-m send-keys -X back-to-indentation
62+bind-key -T copy-mode M-r send-keys -X middle-line
63+bind-key -T copy-mode M-v send-keys -X page-up
64+bind-key -T copy-mode M-w send-keys -X copy-pipe-and-cancel
65+bind-key -T copy-mode M-x send-keys -X jump-to-mark
66+bind-key -T copy-mode "M-{" send-keys -X previous-paragraph
67+bind-key -T copy-mode "M-}" send-keys -X next-paragraph
68+bind-key -T copy-mode M-Up send-keys -X halfpage-up
69+bind-key -T copy-mode M-Down send-keys -X halfpage-down
70+bind-key -T copy-mode C-Up send-keys -X scroll-up
71+bind-key -T copy-mode C-Down send-keys -X scroll-down
72+bind-key -T copy-mode-vi C-b send-keys -X page-up
73+bind-key -T copy-mode-vi C-c send-keys -X cancel
74+bind-key -T copy-mode-vi C-d send-keys -X halfpage-down
75+bind-key -T copy-mode-vi C-e send-keys -X scroll-down
76+bind-key -T copy-mode-vi C-f send-keys -X page-down
77+bind-key -T copy-mode-vi C-h send-keys -X cursor-left
78+bind-key -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel
79+bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel
80+bind-key -T copy-mode-vi C-u send-keys -X halfpage-up
81+bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
82+bind-key -T copy-mode-vi C-y send-keys -X scroll-up
83+bind-key -T copy-mode-vi Escape send-keys -X clear-selection
84+bind-key -T copy-mode-vi Space send-keys -X begin-selection
85+bind-key -T copy-mode-vi \# send-keys -FX search-backward "#{copy_cursor_word}"
86+bind-key -T copy-mode-vi \$ send-keys -X end-of-line
87+bind-key -T copy-mode-vi % send-keys -X next-matching-bracket
88+bind-key -T copy-mode-vi * send-keys -FX search-forward "#{copy_cursor_word}"
89+bind-key -T copy-mode-vi , send-keys -X jump-reverse
90+bind-key -T copy-mode-vi / command-prompt -p "(search down)" "send -X search-forward \"%%%\""
91+bind-key -T copy-mode-vi 0 send-keys -X start-of-line
92+bind-key -T copy-mode-vi 1 command-prompt -N -I 1 -p (repeat) "send -N \"%%%\""
93+bind-key -T copy-mode-vi 2 command-prompt -N -I 2 -p (repeat) "send -N \"%%%\""
94+bind-key -T copy-mode-vi 3 command-prompt -N -I 3 -p (repeat) "send -N \"%%%\""
95+bind-key -T copy-mode-vi 4 command-prompt -N -I 4 -p (repeat) "send -N \"%%%\""
96+bind-key -T copy-mode-vi 5 command-prompt -N -I 5 -p (repeat) "send -N \"%%%\""
97+bind-key -T copy-mode-vi 6 command-prompt -N -I 6 -p (repeat) "send -N \"%%%\""
98+bind-key -T copy-mode-vi 7 command-prompt -N -I 7 -p (repeat) "send -N \"%%%\""
99+bind-key -T copy-mode-vi 8 command-prompt -N -I 8 -p (repeat) "send -N \"%%%\""
100+bind-key -T copy-mode-vi 9 command-prompt -N -I 9 -p (repeat) "send -N \"%%%\""
101+bind-key -T copy-mode-vi : command-prompt -p "(goto line)" "send -X goto-line \"%%%\""
102+bind-key -T copy-mode-vi \; send-keys -X jump-again
103+bind-key -T copy-mode-vi ? command-prompt -p "(search up)" "send -X search-backward \"%%%\""
104+bind-key -T copy-mode-vi A send-keys -X append-selection-and-cancel
105+bind-key -T copy-mode-vi B send-keys -X previous-space
106+bind-key -T copy-mode-vi D send-keys -X copy-end-of-line
107+bind-key -T copy-mode-vi E send-keys -X next-space-end
108+bind-key -T copy-mode-vi F command-prompt -1 -p "(jump backward)" "send -X jump-backward \"%%%\""
109+bind-key -T copy-mode-vi G send-keys -X history-bottom
110+bind-key -T copy-mode-vi H send-keys -X top-line
111+bind-key -T copy-mode-vi J send-keys -X scroll-down
112+bind-key -T copy-mode-vi K send-keys -X scroll-up
113+bind-key -T copy-mode-vi L send-keys -X bottom-line
114+bind-key -T copy-mode-vi M send-keys -X middle-line
115+bind-key -T copy-mode-vi N send-keys -X search-reverse
116+bind-key -T copy-mode-vi T command-prompt -1 -p "(jump to backward)" "send -X jump-to-backward \"%%%\""
117+bind-key -T copy-mode-vi V send-keys -X select-line
118+bind-key -T copy-mode-vi W send-keys -X next-space
119+bind-key -T copy-mode-vi X send-keys -X set-mark
120+bind-key -T copy-mode-vi ^ send-keys -X back-to-indentation
121+bind-key -T copy-mode-vi b send-keys -X previous-word
122+bind-key -T copy-mode-vi e send-keys -X next-word-end
123+bind-key -T copy-mode-vi f command-prompt -1 -p "(jump forward)" "send -X jump-forward \"%%%\""
124+bind-key -T copy-mode-vi g send-keys -X history-top
125+bind-key -T copy-mode-vi h send-keys -X cursor-left
126+bind-key -T copy-mode-vi j send-keys -X cursor-down
127+bind-key -T copy-mode-vi k send-keys -X cursor-up
128+bind-key -T copy-mode-vi l send-keys -X cursor-right
129+bind-key -T copy-mode-vi n send-keys -X search-again
130+bind-key -T copy-mode-vi o send-keys -X other-end
131+bind-key -T copy-mode-vi q send-keys -X cancel
132+bind-key -T copy-mode-vi r send-keys -X refresh-from-pane
133+bind-key -T copy-mode-vi t command-prompt -1 -p "(jump to forward)" "send -X jump-to-forward \"%%%\""
134+bind-key -T copy-mode-vi v send-keys -X rectangle-toggle
135+bind-key -T copy-mode-vi w send-keys -X next-word
136+bind-key -T copy-mode-vi \{ send-keys -X previous-paragraph
137+bind-key -T copy-mode-vi \} send-keys -X next-paragraph
138+bind-key -T copy-mode-vi MouseDown1Pane select-pane
139+bind-key -T copy-mode-vi MouseDrag1Pane select-pane \; send-keys -X begin-selection
140+bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
141+bind-key -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 5 scroll-up
142+bind-key -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 5 scroll-down
143+bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
144+bind-key -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
145+bind-key -T copy-mode-vi BSpace send-keys -X cursor-left
146+bind-key -T copy-mode-vi NPage send-keys -X page-down
147+bind-key -T copy-mode-vi PPage send-keys -X page-up
148+bind-key -T copy-mode-vi Up send-keys -X cursor-up
149+bind-key -T copy-mode-vi Down send-keys -X cursor-down
150+bind-key -T copy-mode-vi Left send-keys -X cursor-left
151+bind-key -T copy-mode-vi Right send-keys -X cursor-right
152+bind-key -T copy-mode-vi M-x send-keys -X jump-to-mark
153+bind-key -T copy-mode-vi C-Up send-keys -X scroll-up
154+bind-key -T copy-mode-vi C-Down send-keys -X scroll-down
155+bind-key -T prefix C-b send-prefix
156+bind-key -T prefix C-f run-shell -b /home/huncho/.tmux/plugins/tmux-fzf/main.sh
157+bind-key -T prefix Tab run-shell "/home/huncho/.tmux/plugins/treemux/scripts/toggle.sh 'nvim,~/.tmux/plugins/treemux/configs/treemux_init.lua,,/usr/bin/python3,left,40,top,70%,editor,0.5,2,@treemux-refresh-interval-inactive-window,0' '#{pane_id}'"
158+bind-key -T prefix Enter run-shell -b "/home/huncho/.tmux/plugins/tmux-notify/scripts/notify.sh false true"
159+bind-key -T prefix C-n next-window
160+bind-key -T prefix C-o rotate-window
161+bind-key -T prefix C-p previous-window
162+bind-key -T prefix C-r run-shell /home/huncho/.tmux/plugins/tmux-resurrect/scripts/restore.sh
163+bind-key -T prefix C-s run-shell /home/huncho/.tmux/plugins/tmux-resurrect/scripts/save.sh
164+bind-key -T prefix C-z suspend-client
165+bind-key -T prefix Space display-menu -T "#[align=centre,bold]#[fg=green,align=centre,bold]tmux#[align=centre,bold]" -x R -y P Run space command-prompt "Last window" tab last-window "Last pane" ` last-pane Copy c "show-wk-menu #{@wk_menu_copy}" '' +Windows w "show-wk-menu #{@wk_menu_windows}" +Panes p "show-wk-menu #{@wk_menu_panes}" +Buffers b "show-wk-menu #{@wk_menu_buffers}" +Sessions s "show-wk-menu #{@wk_menu_sessions}" +Client C "show-wk-menu #{@wk_menu_client}" '' Time T clock-mode "Show messages" \~ show-messages +Keys ? "list-keys -N"
166+bind-key -T prefix ! break-pane
167+bind-key -T prefix \" split-window
168+bind-key -T prefix \# list-buffers
169+bind-key -T prefix \$ command-prompt -I "#S" "rename-session -- '%%'"
170+bind-key -T prefix % split-window -h
171+bind-key -T prefix & confirm-before -p "kill-window #W? (y/n)" kill-window
172+bind-key -T prefix \' command-prompt -W -p index "select-window -t ':%%'"
173+bind-key -T prefix ( switch-client -p
174+bind-key -T prefix ) switch-client -n
175+bind-key -T prefix , command-prompt -I "#W" "rename-window -- '%%'"
176+bind-key -T prefix - delete-buffer
177+bind-key -T prefix / command-prompt -k -p key "list-keys -1N \"%%%\""
178+bind-key -T prefix 0 select-window -t :=0
179+bind-key -T prefix 1 select-window -t :=1
180+bind-key -T prefix 2 select-window -t :=2
181+bind-key -T prefix 3 select-window -t :=3
182+bind-key -T prefix 4 select-window -t :=4
183+bind-key -T prefix 5 select-window -t :=5
184+bind-key -T prefix 6 select-window -t :=6
185+bind-key -T prefix 7 select-window -t :=7
186+bind-key -T prefix 8 select-window -t :=8
187+bind-key -T prefix 9 select-window -t :=9
188+bind-key -T prefix : command-prompt
189+bind-key -T prefix \; last-pane
190+bind-key -T prefix < display-menu -T "#[align=centre]#{window_index}:#{window_name}" -x W -y W "#{?#{>:#{session_windows},1},,-}Swap Left" l "swap-window -t:-1" "#{?#{>:#{session_windows},1},,-}Swap Right" r "swap-window -t:+1" "#{?pane_marked_set,,-}Swap Marked" s swap-window '' Kill X kill-window Respawn R "respawn-window -k" "#{?pane_marked,Unmark,Mark}" m "select-pane -m" Rename n "command-prompt -I \"#W\" \"rename-window -- '%%'\"" '' "New After" w "new-window -a" "New At End" W new-window
191+bind-key -T prefix = choose-buffer -Z
192+bind-key -T prefix > display-menu -T "#[align=centre]#{pane_index} (#{pane_id})" -x P -y P "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Top,}" < "send -X history-top" "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Bottom,}" > "send -X history-bottom" '' "#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}" C-r "if -F \"#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}\" \"copy-mode -t=\" ; send -Xt= search-backward \"#{q:mouse_word}\"" "#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}" C-y "copy-mode -q ; send-keys -l -- \"#{q:mouse_word}\"" "#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}" c "copy-mode -q ; set-buffer -- \"#{q:mouse_word}\"" "#{?mouse_line,Copy Line,}" l "copy-mode -q ; set-buffer -- \"#{q:mouse_line}\"" '' "Horizontal Split" h "split-window -h" "Vertical Split" v "split-window -v" '' "#{?#{>:#{window_panes},1},,-}Swap Up" u "swap-pane -U" "#{?#{>:#{window_panes},1},,-}Swap Down" d "swap-pane -D" "#{?pane_marked_set,,-}Swap Marked" s swap-pane '' Kill X kill-pane Respawn R "respawn-pane -k" "#{?pane_marked,Unmark,Mark}" m "select-pane -m" "#{?#{>:#{window_panes},1},,-}#{?window_zoomed_flag,Unzoom,Zoom}" z "resize-pane -Z"
193+bind-key -T prefix ? display-popup -E "tmux list-keys -T prefix | grep -Po \"(?<=prefix\\s).*\" | fzf --header=\"Prefixed Keys\" --preview=\"echo {}\" --border --preview-window=down:3:wrap | awk '{first = $1; $1=\"\"; print $0}' | sed 's/^ //g' | xargs -I{} tmux {}"
194+bind-key -T prefix A run-shell -b /home/huncho/.tmux/plugins/tmux-ip-address/scripts/update_ip_address.sh
195+bind-key -T prefix C new-window -c "#{pane_current_path}"
196+bind-key -T prefix D choose-client -Z
197+bind-key -T prefix E select-layout -E
198+bind-key -T prefix I run-shell /home/huncho/.tmux/plugins/tpm/bindings/install_plugins
199+bind-key -T prefix L switch-client -l
200+bind-key -T prefix M run-shell -b /home/huncho/.tmux/plugins/tmux-notify/scripts/cancel.sh
201+bind-key -T prefix R run-shell " \t\t\ttmux source-file /home/huncho/.tmux.conf > /dev/null; \t\t\ttmux display-message 'Sourced /home/huncho/.tmux.conf!'"
202+bind-key -T prefix U run-shell /home/huncho/.tmux/plugins/tpm/bindings/update_plugins
203+bind-key -T prefix [ copy-mode
204+bind-key -T prefix ] paste-buffer -p
205+bind-key -T prefix a attach-session -c "#{pane_current_path}" \; display-message "Attached current session to #{pane_current_path}"
206+bind-key -T prefix b last-window
207+bind-key -T prefix c new-window -c "#{pane_current_path}" \; display-message "Opened new window in #{pane_current_path}"
208+bind-key -T prefix d detach-client
209+bind-key -T prefix e show-environment
210+bind-key -T prefix f command-prompt "find-window -Z -- '%%'"
211+bind-key -T prefix g display-popup -E -h 90% -w 90% lazygit
212+bind-key -T prefix i display-message
213+bind-key -T prefix l last-window
214+bind-key -T prefix m run-shell -b /home/huncho/.tmux/plugins/tmux-notify/scripts/notify.sh
215+bind-key -T prefix n next-window
216+bind-key -T prefix o select-pane -t :.+
217+bind-key -T prefix p previous-window
218+bind-key -T prefix q display-panes
219+bind-key -T prefix r source-file /home/huncho/.tmux.conf \; display-popup -E -h 3 -w 30 -x 200 -y 0 "echo Reloaded tmux config; sleep 2"
220+bind-key -T prefix s choose-tree -Zs
221+bind-key -T prefix t clock-mode
222+bind-key -T prefix w choose-tree -Zw
223+bind-key -T prefix x confirm-before -p "kill-pane #P? (y/n)" kill-pane
224+bind-key -T prefix z resize-pane -Z
225+bind-key -T prefix \{ swap-pane -U
226+bind-key -T prefix \} swap-pane -D
227+bind-key -T prefix \~ show-messages
228+bind-key -T prefix BSpace run-shell "/home/huncho/.tmux/plugins/treemux/scripts/toggle.sh 'nvim,~/.tmux/plugins/treemux/configs/treemux_init.lua,,/usr/bin/python3,left,40,top,70%,editor,0.5,2,@treemux-refresh-interval-inactive-window,0,focus' '#{pane_id}'"
229+bind-key -r -T prefix DC refresh-client -c
230+bind-key -T prefix PPage copy-mode -u
231+bind-key -r -T prefix Up select-pane -U
232+bind-key -r -T prefix Down select-pane -D
233+bind-key -r -T prefix Left select-pane -L
234+bind-key -r -T prefix Right select-pane -R
235+bind-key -T prefix M-Enter run-shell -b "/home/huncho/.tmux/plugins/tmux-notify/scripts/notify.sh true true"
236+bind-key -T prefix M-1 select-layout even-horizontal
237+bind-key -T prefix M-2 select-layout even-vertical
238+bind-key -T prefix M-3 select-layout main-horizontal
239+bind-key -T prefix M-4 select-layout main-vertical
240+bind-key -T prefix M-5 select-layout tiled
241+bind-key -T prefix M-m run-shell -b "/home/huncho/.tmux/plugins/tmux-notify/scripts/notify.sh true"
242+bind-key -T prefix M-n next-window -a
243+bind-key -T prefix M-o rotate-window -D
244+bind-key -T prefix M-p previous-window -a
245+bind-key -T prefix M-u run-shell /home/huncho/.tmux/plugins/tpm/bindings/clean_plugins
246+bind-key -r -T prefix M-Up resize-pane -U 5
247+bind-key -r -T prefix M-Down resize-pane -D 5
248+bind-key -r -T prefix M-Left resize-pane -L 5
249+bind-key -r -T prefix M-Right resize-pane -R 5
250+bind-key -r -T prefix C-Up resize-pane -U
251+bind-key -r -T prefix C-Down resize-pane -D
252+bind-key -r -T prefix C-Left resize-pane -L
253+bind-key -r -T prefix C-Right resize-pane -R
254+bind-key -r -T prefix S-Up refresh-client -U 10
255+bind-key -r -T prefix S-Down refresh-client -D 10
256+bind-key -r -T prefix S-Left refresh-client -L 10
257+bind-key -r -T prefix S-Right refresh-client -R 10
258+bind-key -T root MouseDown1Pane select-pane -t = \; send-keys -M
259+bind-key -T root MouseDown1Status select-window -t =
260+bind-key -T root MouseDown2Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" "send -M" "paste -p"
261+bind-key -T root MouseDown3Pane resize-pane -Z
262+bind-key -T root MouseDown3Status display-menu -T "#[align=centre]#{window_index}:#{window_name}" -t = -x W -y W "#{?#{>:#{session_windows},1},,-}Swap Left" l "swap-window -t:-1" "#{?#{>:#{session_windows},1},,-}Swap Right" r "swap-window -t:+1" "#{?pane_marked_set,,-}Swap Marked" s swap-window '' Kill X kill-window Respawn R "respawn-window -k" "#{?pane_marked,Unmark,Mark}" m "select-pane -m" Rename n "command-prompt -I \"#W\" \"rename-window -- '%%'\"" '' "New After" w "new-window -a" "New At End" W new-window
263+bind-key -T root MouseDown3StatusLeft display-menu -T "#[align=centre]#{session_name}" -t = -x M -y W Next n "switch-client -n" Previous p "switch-client -p" '' Renumber N "move-window -r" Rename n "command-prompt -I \"#S\" \"rename-session -- '%%'\"" '' "New Session" s new-session "New Window" w new-window
264+bind-key -T root MouseDrag1Pane if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" "send -M" "copy-mode -M"
265+bind-key -T root MouseDrag1Border resize-pane -M
266+bind-key -T root WheelUpPane if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" "send -M" "copy-mode -e"
267+bind-key -T root WheelUpStatus previous-window
268+bind-key -T root WheelDownStatus next-window
269+bind-key -T root DoubleClick1Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" "send -M" "copy-mode -H ; send -X select-word ; run -d0.3 ; send -X copy-pipe-and-cancel"
270+bind-key -T root TripleClick1Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" "send -M" "copy-mode -H ; send -X select-line ; run -d0.3 ; send -X copy-pipe-and-cancel"
271+bind-key -T root M-h select-pane -L
272+bind-key -T root M-i previous-window
273+bind-key -T root M-j select-pane -D
274+bind-key -T root M-k select-pane -U
275+bind-key -T root M-l select-pane -R
276+bind-key -T root M-m resize-pane -Z
277+bind-key -T root M-o next-window
278+bind-key -T root M-p split-window -v \; select-layout tiled
279+bind-key -T root M-q kill-session
280+bind-key -T root M-t select-layout tiled
281+bind-key -T root M-MouseDown3Pane display-menu -T "#[align=centre]#{pane_index} (#{pane_id})" -t = -x M -y M "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Top,}" < "send -X history-top" "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Bottom,}" > "send -X history-bottom" '' "#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}" C-r "if -F \"#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}\" \"copy-mode -t=\" ; send -Xt= search-backward \"#{q:mouse_word}\"" "#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}" C-y "copy-mode -q ; send-keys -l -- \"#{q:mouse_word}\"" "#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}" c "copy-mode -q ; set-buffer -- \"#{q:mouse_word}\"" "#{?mouse_line,Copy Line,}" l "copy-mode -q ; set-buffer -- \"#{q:mouse_line}\"" '' "Horizontal Split" h "split-window -h" "Vertical Split" v "split-window -v" '' "#{?#{>:#{window_panes},1},,-}Swap Up" u "swap-pane -U" "#{?#{>:#{window_panes},1},,-}Swap Down" d "swap-pane -D" "#{?pane_marked_set,,-}Swap Marked" s swap-pane '' Kill X kill-pane Respawn R "respawn-pane -k" "#{?pane_marked,Unmark,Mark}" m "select-pane -m" "#{?#{>:#{window_panes},1},,-}#{?window_zoomed_flag,Unzoom,Zoom}" z "resize-pane -Z"
+15-0scripts/get_and_run.sh
@@ -0,0 +1,15 @@
1+#!/bin/bash
2+get_and_run() {
3+ local selection=$(
4+ tmux list-keys |
5+ fzf --header=$'\nFuzzy trigger any tmux command\n to run | Esc to quit' \
6+ --preview="echo {}" \
7+ --border \
8+ --preview-window=down:3:wrap
9+ )
10+ local command=$(echo $selection |
11+ awk '{ $1=""; $2=""; $3=""; $4=""; print $0 }' |
12+ sed 's/^ *//')
13+ tmux run-shell "tmux $command"
14+}
15+get_and_run
+3-0tmux-fzf-keys.tmux
@@ -0,0 +1,3 @@
1+if-shell '[ -n "#{plugin_path}" ]' \
2+ "bind ? display-popup -E '#{plugin_path}/scripts/get_and_run.sh'" \
3+ "bind ? display-popup -E '$HOME/.tmux/local/tmux-fzf-keys/scripts/get_and_run.sh'"