Add tmux alt+arrow bindings if missing
This commit is contained in:
@@ -3,7 +3,4 @@
|
|||||||
# Overwrite the user tmux config with the Omarchy default and reload tmux.
|
# Overwrite the user tmux config with the Omarchy default and reload tmux.
|
||||||
|
|
||||||
omarchy-refresh-config tmux/tmux.conf
|
omarchy-refresh-config tmux/tmux.conf
|
||||||
|
omarchy-restart-tmux
|
||||||
if pgrep -x tmux; then
|
|
||||||
tmux source-file ~/.config/tmux/tmux.conf
|
|
||||||
fi
|
|
||||||
|
|||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Restart tmux if running with the latest configuration
|
||||||
|
|
||||||
|
if pgrep -x tmux; then
|
||||||
|
tmux source-file ~/.config/tmux/tmux.conf
|
||||||
|
fi
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
echo "Add Alt+Arrow keybindings for tmux window and session navigation"
|
||||||
|
|
||||||
|
TMUX_CONF=~/.config/tmux/tmux.conf
|
||||||
|
|
||||||
|
if [[ -f $TMUX_CONF ]]; then
|
||||||
|
# Add M-Left/M-Right after M-9 if not present
|
||||||
|
if ! grep -q "bind -n M-Left select-window" "$TMUX_CONF"; then
|
||||||
|
sed -i '/bind -n M-9 select-window -t 9/a\
|
||||||
|
bind -n M-Left select-window -t -1\
|
||||||
|
bind -n M-Right select-window -t +1' "$TMUX_CONF"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add M-Up/M-Down after "bind N switch-client -n" if not present
|
||||||
|
if ! grep -q "bind -n M-Up switch-client" "$TMUX_CONF"; then
|
||||||
|
sed -i '/^bind N switch-client -n$/a\
|
||||||
|
bind -n M-Up switch-client -p\
|
||||||
|
bind -n M-Down switch-client -n' "$TMUX_CONF"
|
||||||
|
fi
|
||||||
|
|
||||||
|
omarchy-restart-tmux
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user