From 5b6d2f2232696d898c1ccf70050551762fc33591 Mon Sep 17 00:00:00 2001 From: bchanot Date: Fri, 9 Oct 2026 15:44:36 +0200 Subject: [PATCH] feat(tmux): Ctrl+Alt+arrow moves between panes without the prefix, copy-mode too (macOS: Ctrl+Cmd+arrow via iTerm2 escape-sequence mapping); CHANGELOG --- CHANGELOG.md | 1 + tmux.conf | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48e1dcf..bc54e80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versioning: se - `tmux.conf`: window tabs centred in the status bar (`absolute-centre`), with index, padding and a blank between tabs; the current tab bold on a light pill. - `bin/tmux-copy-exit-keys` + `tmux.conf`: after a mouse selection any bare key leaves copy-mode and returns to the prompt (key swallowed); ctrl/alt keys, and copy-mode opened from the keyboard or the wheel, keep their vi role. - `tmux.conf`: Alt+Left/Right switch windows without the prefix (macOS: map Cmd+arrow in iTerm2 to the `[1;3D` / `[1;3C` escape sequences). +- `tmux.conf`: Ctrl+Alt+arrow moves between panes without the prefix, in copy-mode too (macOS: map Ctrl+Cmd+arrow in iTerm2 to `[1;7A` `[1;7B` `[1;7D` `[1;7C`). ### Changed - `.githooks/post-commit` and `post-merge` fail closed on `gitflow.autopush`: an unreadable or non-boolean value means no push, with a named warning (was: silently treated as `true`). diff --git a/tmux.conf b/tmux.conf index 9470c61..4e64a0a 100644 --- a/tmux.conf +++ b/tmux.conf @@ -151,6 +151,17 @@ bind -T copy-mode-vi C-u select-pane -U bind -T copy-mode-vi C-h select-pane -L bind -T copy-mode-vi C-j select-pane -D bind -T copy-mode-vi C-k select-pane -R +# Ctrl+Alt+arrow too (no prefix), straight to the pane, no vim pass-through. +# Native on Linux/PC; on macOS map Ctrl+Cmd+arrow in iTerm2 to the xterm +# Ctrl+Alt+arrow sequences (Send Escape Sequence `[1;7A` `[1;7B` `[1;7D` `[1;7C`). +bind -n C-M-Up select-pane -U +bind -n C-M-Down select-pane -D +bind -n C-M-Left select-pane -L +bind -n C-M-Right select-pane -R +bind -T copy-mode-vi C-M-Up select-pane -U +bind -T copy-mode-vi C-M-Down select-pane -D +bind -T copy-mode-vi C-M-Left select-pane -L +bind -T copy-mode-vi C-M-Right select-pane -R bind Escape copy-mode # bind vi-like 'normal' mode bind -Tcopy-mode-vi 'v' send -X begin-selection # bind vi-like visual mode