X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.tmux.conf;h=e383a3783a3c7bf8bc3f8900987153299cd356d8;hp=c2c3688e179adce7a9bdfbd6cf1983999e8c2d08;hb=40bb8565e90e541eb6eeae62d12b2f8f82d56883;hpb=422d35463c5670d03dfd078368a161ab76ed535e diff --git a/.tmux.conf b/.tmux.conf index c2c3688..e383a37 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -16,6 +16,14 @@ 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. ################################################################################ @@ -23,8 +31,6 @@ set -g prefix C-p unbind C-b bind C-p last-window bind p send-keys C-p -bind C-l refresh-client -bind l refresh-client bind S split-window -v bind | split-window -h bind C-[ copy-mode @@ -40,17 +46,22 @@ bind > command-prompt -p "Save buffer to file:" 'save-buffer %1' ################################################################################ # Up and down like Vim. bind j select-pane -D -bind C-j select-pane -D +bind -r C-j select-pane -D bind k select-pane -U -bind C-k select-pane -U +bind -r C-k select-pane -U +# Don't let arrow keys repeat. +bind Up select-pane -U +bind Down select-pane -D +bind Left select-pane -L +bind Right select-pane -R # Previous and next panes kinda like Vim. bind h select-pane -L -bind C-h select-pane -L +bind -r C-h select-pane -L bind l select-pane -R -bind C-l select-pane -R +bind -r C-l select-pane -R # And for windows. -bind H previous-window -bind L next-window +bind -r H previous-window +bind -r L next-window # Last window like Vim. bind ^ last-window bind C-^ last-pane @@ -58,24 +69,52 @@ 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 -r C-o swap-pane -D +bind -r 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 :.+ -bind I select-pane -t :.- +bind -r C-i select-pane -t :.+ +bind -r I select-pane -t :.- +# Resize pane. +bind -r C-M-h resize-pane -L +bind -r C-M-j resize-pane -D +bind -r C-M-k resize-pane -U +bind -r C-M-l resize-pane -R # Layouts. -bind . select-layout even-vertical -bind , select-layout tiled +bind , select-layout even-vertical +bind . select-layout even-horizontal +bind / select-layout tiled +bind M-, select-layout main-vertical +bind M-. select-layout main-horizontal +bind Space next-layout +bind -r C-Space next-layout # Simulate maximising the window. -bind / select-layout even-vertical \; swap-pane -s top \; resize-pane -D 9999 -# Show windows -bind - list-windows +bind / select-layout main-horizontal \; resize-pane -D 9999 +bind M-/ select-layout tiled +# 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. @@ -93,7 +132,9 @@ bind { copy-mode -u # XXX: As of tmux 1.3 this doesn't work. #bind '"' choose-buffer 'show-buffer -b %%' bind '"' list-buffers \; command-prompt -p "Choose buffer to show:" 'show-buffer -b %1' -bind "'" show-buffer +bind "'" new-window -n "[buffer]" "cat > /dev/null" \; paste-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. @@ -114,7 +155,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.