Skip to content

Commit 7d5427f

Browse files
committed
feat(tmux): add layout prefix mode with multiple pane layouts
Add Prefix + Backspace + [number] for quick layout selection: - 1: Dev layout (4-pane for agentic coding) - 2: 2x2 grid - 3: 3x3 grid (using tiled layout)
1 parent 928f9b0 commit 7d5427f

1 file changed

Lines changed: 29 additions & 3 deletions

File tree

dotfiles/tmux/.tmux.conf

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,12 @@ bind-key -T dev_prefix 7 if -F '#{&&:#{window_zoomed_flag},#{!=:#{pane_index},7}
143143
bind-key -T dev_prefix 8 if -F '#{&&:#{window_zoomed_flag},#{!=:#{pane_index},8}}' 'select-pane -t 8; resize-pane -Z; switch-client -T dev_prefix' 'select-pane -t 8; switch-client -T dev_prefix'
144144
bind-key -T dev_prefix 9 if -F '#{&&:#{window_zoomed_flag},#{!=:#{pane_index},9}}' 'select-pane -t 9; resize-pane -Z; switch-client -T dev_prefix' 'select-pane -t 9; switch-client -T dev_prefix'
145145

146-
# Development layout creator (Prefix + Backspace)
147-
# Creates 4-pane layout for agentic coding:
146+
# -----------------------------------------------------------------------------------------------------
147+
# LAYOUT PREFIX MODE (Prefix + Backspace + [number])
148+
# -----------------------------------------------------------------------------------------------------
149+
bind-key BSpace switch-client -T layout_prefix
150+
151+
# Layout 1: Dev layout for agentic coding
148152
# +-------+-------------------+
149153
# | | |
150154
# | 0 | 1: editor |
@@ -155,7 +159,29 @@ bind-key -T dev_prefix 9 if -F '#{&&:#{window_zoomed_flag},#{!=:#{pane_index},9}
155159
# | | cmd1 | cmd2 |
156160
# | | (25%) | (25%) |
157161
# +-------+--------+----------+
158-
bind-key BSpace split-window -h -c '#{pane_current_path}' \; resize-pane -x 50% \; split-window -v -c '#{pane_current_path}' \; resize-pane -y 25% \; split-window -h -c '#{pane_current_path}' \; select-pane -t 1
162+
bind-key -T layout_prefix 1 split-window -h -c '#{pane_current_path}' \; resize-pane -x 50% \; split-window -v -c '#{pane_current_path}' \; resize-pane -y 25% \; split-window -h -c '#{pane_current_path}' \; select-pane -t 0
163+
164+
# Layout 2: 2x2 grid
165+
# +-------+-------+
166+
# | 0 | 1 |
167+
# +-------+-------+
168+
# | 2 | 3 |
169+
# +-------+-------+
170+
bind-key -T layout_prefix 2 split-window -h -c '#{pane_current_path}' \; select-pane -t 0 \; split-window -v -c '#{pane_current_path}' \; select-pane -t 2 \; split-window -v -c '#{pane_current_path}' \; select-pane -t 0
171+
172+
# Layout 3: 3x3 grid (uses tiled layout for even distribution)
173+
# +-------+-------+-------+
174+
# | 0 | 3 | 4 |
175+
# +-------+-------+-------+
176+
# | 1 | 5 | 6 |
177+
# +-------+-------+-------+
178+
# | 2 | 7 | 8 |
179+
# +-------+-------+-------+
180+
bind-key -T layout_prefix 3 split-window -v -c '#{pane_current_path}' \; split-window -v -c '#{pane_current_path}' \; select-pane -t 0 \; split-window -h -c '#{pane_current_path}' \; split-window -h -c '#{pane_current_path}' \; select-pane -t 1 \; split-window -h -c '#{pane_current_path}' \; split-window -h -c '#{pane_current_path}' \; select-pane -t 2 \; split-window -h -c '#{pane_current_path}' \; split-window -h -c '#{pane_current_path}' \; select-layout tiled \; select-pane -t 0
181+
182+
# Exit layout prefix mode
183+
bind-key -T layout_prefix Escape switch-client -T root
184+
bind-key -T layout_prefix q switch-client -T root
159185

160186
# Exit dev prefix mode with Escape or q
161187
bind-key -T dev_prefix Escape switch-client -T root

0 commit comments

Comments
 (0)