From ca99fe54cbc6d1bce4505f2a00f4c6e3adce2b4f Mon Sep 17 00:00:00 2001 From: Eragos Date: Sat, 23 Apr 2016 16:42:02 +0200 Subject: [PATCH] useful tmux changes - set history size - show tmux msgs longer - key binding s|S for sync panes - key binding m|M for man - double tab C-b to switch to the last window --- .tmux.conf | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 7388d4a..d4de022 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -9,7 +9,10 @@ set -g default-terminal "screen-256color" set-option -g detach-on-destroy off # Scroll History -#set -g history-limit 30000 +set-option -g history-limit 10000 + +# keep tmux msgs around longer +set -g display-time 2000 # Set ability to capture on start and restore on exit window data when running an application setw -g alternate-screen on @@ -18,17 +21,17 @@ setw -g alternate-screen on set -s escape-time 50 # loud or quiet? +set-window-option -g monitor-activity off set-option -g visual-activity off set-option -g visual-bell off set-option -g visual-silence off -set-window-option -g monitor-activity off set-option -g bell-action none # mouse -set -g mode-mouse on -set -g mouse-select-pane on -set -g mouse-resize-pane -set -g mouse-select-window on +set-window-option -g mouse-mode on +set-option -g mouse-select-window on +set-option -g mouse-select-pane on +set-option -g mouse-resize-pane on ########################################## @@ -90,8 +93,9 @@ set -g status-left '' ### some tmux tweaks ########################################## -# Use vim keybindings in copy mode -setw -g mode-keys vi +# Use vim mode keys +set-option -g status-keys vi +set-option -g mode-keys vi # Setup 'v' to begin selection as in Vim bind-key -t vi-copy v begin-selection @@ -101,27 +105,33 @@ bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" unbind -t vi-copy Enter bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" - # split panes using | and -, open new pane in current directory bind | send-keys " ~/.tmux/newpanes -h" C-m bind - send-keys " ~/.tmux/newpanes -v" C-m unbind '"' unbind % - # Start windows and panes at 1, not 0 set -g base-index 1 setw -g pane-base-index 1 - # reload config file (change file location to your the tmux.conf you want to use) bind r source-file ~/.tmux.conf \; display "tmux config reloaded..." - # Setup 'x' zoom into a panes (maximize) an save/restore other panes in the current window bind x run ". ~/.tmux/zoom" - # set terminal title set -g set-titles on -set -g set-titles-string '#(whoami)@#h | #(curl ipecho.net/plain;echo)' \ No newline at end of file +set -g set-titles-string '#(whoami)@#h | #(curl ipecho.net/plain;echo)' + +# duplicate input to all panes in the same window +bind S set-window-option synchronize-panes on +bind s set-window-option synchronize-panes off + +# open a man page in new pane or window +bind m command-prompt -p "man page:" "split-window -h 'exec man %%'" +bind M command-prompt -p "Man page:" "new-window -n 'man %1' 'exec man %1'" + +# Double tapping the prefix jumps to last window +bind-key C-b last-window \ No newline at end of file