From e97f076c557523390aa86454ee4ba2f911648a33 Mon Sep 17 00:00:00 2001 From: Sampo Sorsa Date: Tue, 30 Jan 2018 00:00:00 +0000 Subject: [PATCH] Swap last-window & send-prefix bindings C-a is last-window, a is send-prefix. This is consistent with screen bindings; C-a C-a toggles to last window, and C-a a sends the command character. last-window is usually also needed more often, so it makes sense to make it more accessible. Fixes #40. --- CHANGELOG.md | 1 + README.md | 4 ++-- sensible.tmux | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 579c0db..c8fc823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ### master +- swap `last-window` & `send-prefix` bindings - remove `detach-on-destroy` - do not set `aggressive-resize` on iTerm terminal - disable `detach-on-destroy` diff --git a/README.md b/README.md index 7185b67..09021f5 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,8 @@ allowing you to hold `Ctrl` and repeat `a + p`/`a + n` (if your prefix is "Adaptable" key bindings that build upon your `prefix` value: # if prefix is 'C-a' - bind C-a send-prefix - bind a last-window + bind C-a last-window + bind a send-prefix If prefix is `C-b`, above keys will be `C-b` and `b`.
If prefix is `C-z`, above keys will be `C-z` and `z`... you get the idea. diff --git a/sensible.tmux b/sensible.tmux index 5cf2af6..a7b3fec 100755 --- a/sensible.tmux +++ b/sensible.tmux @@ -131,16 +131,16 @@ main() { tmux unbind-key C-b fi - # pressing `prefix + prefix` sends to the shell + # pressing `Ctrl-prefix + prefix` sends to the shell if key_binding_not_set "$prefix"; then - tmux bind-key "$prefix" send-prefix + tmux bind-key "$prefix_without_ctrl" send-prefix fi fi - # If Ctrl-a is prefix then `Ctrl-a + a` switches between alternate windows. + # If Ctrl-a is prefix then `Ctrl-a + Ctrl-a` switches between alternate windows. # Works for any prefix character. if key_binding_not_set "$prefix_without_ctrl"; then - tmux bind-key "$prefix_without_ctrl" last-window + tmux bind-key "$prefix" last-window fi # easier switching between next/prev window