From 6a0277a2fc812435e28c44baa49d2cd4c454cfc6 Mon Sep 17 00:00:00 2001 From: Alexey Samoshkin Date: Thu, 23 Nov 2017 00:25:31 +0200 Subject: [PATCH] Add keybinding to close all other windows but current one --- readme.md | 16 +++++++++++----- tmux/tmux.conf | 5 +++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index e96f2d0..ce1ca0d 100644 --- a/readme.md +++ b/readme.md @@ -30,9 +30,7 @@ TBD: - [ ] retain current path when new pane is created - [ ] integration with clipboard - [ ] fix pane resizing -- [ ] key binding to close all windows but current one - [ ] fix installation script to properly install TPM -- [ ] change zoom action key binding to `prefix +` Installation @@ -140,16 +138,24 @@ Let's go through them: <prefix> C-o Swap current active pane with next one + + <prefix> + + Toggle zoom for current pane + <prefix> x Kill current pane - <prefix> C-x - Kill current window (with confirmation) + <prefix> X + Kill current window - <prefix> X + <prefix> C-x + Kill other windows but current one (with confirmation) + + + <prefix> C-q Kill current session (with confirmation) diff --git a/tmux/tmux.conf b/tmux/tmux.conf index e9aea61..0545961 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -86,8 +86,9 @@ bind -r C-o swap-pane -D # Kill pane/window/session shortcuts unbind & bind x kill-pane -bind C-x confirm-before -p "kill-window #W? (y/n)" kill-window -bind X confirm-before -p "kill-session #S? (y/n)" kill-session +bind X kill-window +bind C-x confirm-before -p "kill other windows? (y/n)" "kill-window -a" +bind C-q confirm-before -p "kill-session #S? (y/n)" kill-session # Merge session with another one (e.g. move all windows) # If you use adhoc 1-window sessions, and you want to preserve session upon exit