X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.tmux.conf;h=3345bd02e4da077c010dc202beb65d571e66119d;hp=76a9eb34403a9590359c0edd7edbda8a1893ea3f;hb=93d2fe039997080cdf4d2177d8092e08093aef72;hpb=c1097d966d9eab20f4a59d1d176c91f40e8aa39b diff --git a/.tmux.conf b/.tmux.conf index 76a9eb3..3345bd0 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -13,6 +13,17 @@ set -s escape-time 100 setw -g clock-mode-colour white setw -g clock-mode-style 24 +# Scrollback buffer. +set -g history-limit 4096 + +# Don't use the mouse to select text by default. +# It has two important flaws. Double-clicking to select a word doesn't work. +# Middle clicking to paste doesn't work. +set -g mouse-resize-pane off +set -g mouse-select-pane off +set -g mouse-select-window off +set -g mode-mouse off + ################################################################################ # Screen compatibility. ################################################################################ @@ -55,13 +66,20 @@ bind C-^ last-pane bind J select-pane -D bind K select-pane -U # Swap panes. -bind w swap-pane +bind o swap-pane -D +bind C-o swap-pane -D +bind O swap-pane -U +bind w command-prompt -p "Select [.] to swap:" 'swap-pane -s . -t %1' +# Swap windows. +bind W choose-window "swap-window -t '%%'" # Show panes. bind = display-panes # Move the current pane into a separate window. bind b break-pane # Split another pane into this window. -bind B command-prompt -p "Select [.] to join:" 'join-pane -s %1' +bind B command-prompt -p "Select [.] to join:" 'join-pane -s %1' +# Split vertically. +bind C-\ split-window -v # Next pane. bind i select-pane -t :.+ bind C-i select-pane -t :.+ @@ -71,8 +89,18 @@ bind . select-layout even-vertical bind , select-layout tiled # Simulate maximising the window. bind / select-layout even-vertical \; swap-pane -s top \; resize-pane -D 9999 -# Show windows -bind - list-windows +# Select windows. +bind - choose-window +bind M-0 select-window -t 10 +bind M-1 select-window -t 11 +bind M-2 select-window -t 12 +bind M-3 select-window -t 13 +bind M-4 select-window -t 14 +bind M-5 select-window -t 15 +bind M-6 select-window -t 16 +bind M-7 select-window -t 17 +bind M-8 select-window -t 18 +bind M-9 select-window -t 19 # Set current window title. bind t command-prompt -p "Set window's title to:" 'rename-window %1' # Show clock. @@ -91,6 +119,8 @@ bind { copy-mode -u #bind '"' choose-buffer 'show-buffer -b %%' bind '"' list-buffers \; command-prompt -p "Choose buffer to show:" 'show-buffer -b %1' bind "'" show-buffer +# Toggle mouse mode as it is useful despite the flaws listed above. +bind C-m set -g mouse-resize-pane \; set -g mouse-select-pane \; set -g mouse-select-window \; set -g mode-mouse ################################################################################ # Fix missing binds in Vi modes. @@ -111,7 +141,7 @@ bind -t vi-copy y copy-selection ################################################################################ set -g default-terminal 'screen-256color' # PuTTY needs help to set bold colours. -set -g terminal-overrides 'putty-256color:C8' +set -a -g terminal-overrides ',putty-256color:C8:Ms=\\E]52;%p1%s;%p2%s\\007m' ################################################################################ # Window and pane settings.