tmux: Add a 'resize mode' similar to my i3 config

Add a 'resize mode' that behaves similar to the one in my i3 config.
When pressing the binding `<prefix>r`, a new key-table is selected that
allows resizing with `hjkl` as well as choosing the different layouts
directly over the number row.
This commit is contained in:
2022-06-27 02:40:22 +02:00
parent e0fdd45e6c
commit 18625091ed

View File

@@ -76,23 +76,24 @@ bind h selectp -L
bind j selectp -D
bind k selectp -U
bind l selectp -R
# Resize panes with Alt-Shift-[hjkl]
bind -n M-H resizep -L
bind -n M-J resizep -D
bind -n M-K resizep -U
bind -n M-L resizep -R
# Resize mode similar to my i3 config
bind -T resize h resizep -L \; switchc -T resize
bind -T resize j resizep -D \; switchc -T resize
bind -T resize k resizep -U \; switchc -T resize
bind -T resize l resizep -R \; switchc -T resize
bind -T resize 1 selectl even-horizontal \; switchc -T resize
bind -T resize 2 selectl even-vertical \; switchc -T resize
bind -T resize 3 selectl main-horizontal \; switchc -T resize
bind -T resize 4 selectl main-vertical \; switchc -T resize
bind -T resize 5 selectl tiled \; switchc -T resize
bind r switchc -T resize
# Allow C-h to still be passed (when programs expect it as backspace, e.g. UEFI
# shell)
bind -r -T selfinsert C-h send C-h
bind C-v switchc -T selfinsert
# Resize panes with Alt-Shift-<arrow>
bind -n M-S-Left resizep -L
bind -n M-S-Up resizep -D
bind -n M-S-Down resizep -U
bind -n M-S-Right resizep -R
# Synchronize the panes in the current window with `<prefix>S`
bind S set -w synchronize-panes