Add Alt+Shift+Arrow keybindings for swapping tmux windows

This commit is contained in:
David Heinemeier Hansson
2026-03-01 16:33:04 +01:00
parent 80224cb954
commit 149bf44763
2 changed files with 15 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
echo "Add Alt+Shift+Arrow keybindings for swapping tmux windows"
TMUX_CONF=~/.config/tmux/tmux.conf
if [[ -f $TMUX_CONF ]]; then
if ! grep -q "bind -n M-S-Left swap-window" "$TMUX_CONF"; then
sed -i '/bind -n M-Right select-window -t +1/a\
bind -n M-S-Left swap-window -t -1 \\; select-window -t -1\
bind -n M-S-Right swap-window -t +1 \\; select-window -t +1' "$TMUX_CONF"
fi
omarchy-restart-tmux
fi