From 870fe16b0a02e16ede2328826b34631f03758dfe Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 15 May 2026 13:39:17 +0200 Subject: [PATCH] Add Alt+esc to close a pane too --- config/tmux/tmux.conf | 2 ++ migrations/1778752973.sh | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf index 2414ebf3..53990431 100644 --- a/config/tmux/tmux.conf +++ b/config/tmux/tmux.conf @@ -15,6 +15,8 @@ bind -T copy-mode-vi y send -X copy-selection-and-cancel # Pane Controls bind -n M-Enter split-window -v -c "#{pane_current_path}" bind -n M-S-Enter split-window -h -c "#{pane_current_path}" +bind -n M-Escape kill-pane + bind h split-window -v -c "#{pane_current_path}" bind v split-window -h -c "#{pane_current_path}" bind x kill-pane diff --git a/migrations/1778752973.sh b/migrations/1778752973.sh index 7a3079e5..ed1facc8 100644 --- a/migrations/1778752973.sh +++ b/migrations/1778752973.sh @@ -1,4 +1,4 @@ -echo "Add Alt+Enter and Alt+Shift+Enter split keybindings to tmux" +echo "Add Alt+Enter split and Alt+Escape close keybindings to tmux" tmux_config="$HOME/.config/tmux/tmux.conf" @@ -15,6 +15,11 @@ if [[ -f $tmux_config ]]; then changed=1 fi + if ! grep -qxF 'bind -n M-Escape kill-pane' "$tmux_config"; then + printf 'bind -n M-Escape kill-pane\n' >>"$tmux_config" + changed=1 + fi + if (( changed )); then omarchy-restart-tmux fi