From 94c093e0878c000a4bb5d533a07cb9406dbf33d8 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Tue, 22 Jul 2014 21:48:54 -0400 Subject: [PATCH] Start counting windows/panes @ 1 and add direct switching with M-[0-9] --- README.md | 1 + tmux.normal.conf | 16 +++++++++++++++- tmux.powerline.conf | 16 +++++++++++++++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6656625..9748161 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ * `?` and `/`: Show help for available key bindings and commands respectively. * `y` and `Ctrl-p`: Enter __copy mode__ and paste from the copy buffer respectively. * (**copy mode**) `v`, `y` and `Escape`: Begin selection, copy selection and cancel **copy mode** respectively. +* `Alt-[0-9]` (no prefix): Switch directly to the given window. ## Credits ## diff --git a/tmux.normal.conf b/tmux.normal.conf index 79867a3..2595dc8 100644 --- a/tmux.normal.conf +++ b/tmux.normal.conf @@ -22,7 +22,9 @@ bind Space send-prefix # SETTINGS # # general -set-option -g default-terminal "screen-256color" #set $TERM to screen-256color for compatibility with programs expecting colour +set-option -g default-terminal "screen-256color" #set $TERM variable (urxvt users use: rxvt-unicode-256color) +set-option -g base-index 1 #start counting windows at 1 instead of 0 (for more logical keboard-switching) +set-option -g pane-base-index 1 #start counting panes at 1 instead of 0 set-option -g renumber-windows on #when a window is closed, renumber the remaining windows set-option -g set-titles on #attempt to set the terminal title set-option -g set-titles-string "#I:#P - #W - #T" #string used to set the terminal title @@ -113,6 +115,18 @@ bind C-p paste-buffer bind -t vi-copy y copy-selection bind -t vi-copy v begin-selection bind -t vi-copy Escape cancel +# +# bind ctrl-[0-9] to switching directly to the respective window +bind -n M-1 select-window -t 1 +bind -n M-2 select-window -t 2 +bind -n M-3 select-window -t 3 +bind -n M-4 select-window -t 4 +bind -n M-5 select-window -t 5 +bind -n M-6 select-window -t 6 +bind -n M-7 select-window -t 7 +bind -n M-8 select-window -t 8 +bind -n M-9 select-window -t 9 +bind -n M-0 select-window -t 10 # STATUS LINE # diff --git a/tmux.powerline.conf b/tmux.powerline.conf index 738a07a..440e0c4 100644 --- a/tmux.powerline.conf +++ b/tmux.powerline.conf @@ -22,7 +22,9 @@ bind Space send-prefix # SETTINGS # # general -set-option -g default-terminal "screen-256color" #set $TERM to screen-256color for compatibility with programs expecting colour +set-option -g default-terminal "screen-256color" #set $TERM variable (urxvt users use: rxvt-unicode-256color) +set-option -g base-index 1 #start counting windows at 1 instead of 0 (for more logical keboard-switching) +set-option -g pane-base-index 1 #start counting panes at 1 instead of 0 set-option -g renumber-windows on #when a window is closed, renumber the remaining windows set-option -g set-titles on #attempt to set the terminal title set-option -g set-titles-string "#I:#P - #W - #T" #string used to set the terminal title @@ -113,6 +115,18 @@ bind C-p paste-buffer bind -t vi-copy y copy-selection bind -t vi-copy v begin-selection bind -t vi-copy Escape cancel +# +# bind ctrl-[0-9] to switching directly to the respective window +bind -n M-1 select-window -t 1 +bind -n M-2 select-window -t 2 +bind -n M-3 select-window -t 3 +bind -n M-4 select-window -t 4 +bind -n M-5 select-window -t 5 +bind -n M-6 select-window -t 6 +bind -n M-7 select-window -t 7 +bind -n M-8 select-window -t 8 +bind -n M-9 select-window -t 9 +bind -n M-0 select-window -t 10 # STATUS LINE #