Load matchit plugin where available.
[profile.git] / .tmux.conf
index 9b915df..2ac48a8 100644 (file)
@@ -1,6 +1,10 @@
 ################################################################################
 # Options.
 ################################################################################
+# Start in home.  The documentation says ~ is supported but tmux 1.7
+# barfs on it.
+set -g default-path "$HOME"
+
 # Use vi keys for scrolling etc.
 # Use lsk -t vi|emacs-<table> to see binds in table choice, copy or edit.
 setw -g mode-keys vi
@@ -37,6 +41,7 @@ bind C-[ copy-mode
 bind ] paste-buffer
 bind C-] paste-buffer
 bind _ setw monitor-activity
+bind M-_ setw monitor-silence 10
 bind * list-clients
 bind < command-prompt -p "Load buffer from file:" 'load-buffer %1'
 bind > command-prompt -p "Save buffer to file:" 'save-buffer %1'
@@ -46,30 +51,37 @@ 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
+bind C-o last-pane
 # Top and bottom.
 bind J select-pane -D
 bind K select-pane -U
 # Swap panes.
 bind o swap-pane -D
-bind C-o swap-pane -D
-bind O swap-pane -U
+bind -r O swap-pane -U
 bind w command-prompt -p "Select [<window>.]<pane> to swap:" 'swap-pane -s . -t %1'
 # Swap windows.
 bind W choose-window "swap-window -t '%%'"
+# Renumber windows.
+bind M-w move-window -r -s : -t :
 # Show panes.
 bind = display-panes
 # Move the current pane into a separate window.
@@ -80,13 +92,24 @@ bind B command-prompt -p "Select <window>[.<pane>] to join:" 'join-pane -s %1'
 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
+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
@@ -116,9 +139,12 @@ 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
+# As of tmux 1.7 mode-mouse has three possible values so we can no
+# longer use an implied toggle.
+bind C-m set -g mouse-resize-pane on \; set -g mouse-select-pane on \; set -g mouse-select-window on \; set -g mode-mouse copy-mode
+bind M-m set -g mouse-resize-pane off \; set -g mouse-select-pane off \; set -g mouse-select-window off \; set -g mode-mouse off
 
 ################################################################################
 # Fix missing binds in Vi modes.
@@ -150,9 +176,11 @@ set -g display-panes-colour colour17
 # Command entry.
 set -g message-bg colour90
 set -g message-fg white
+set -g message-command-bg colour88
+set -g message-command-fg white
 # Active pane
 set -g pane-active-border-bg default
-set -g pane-active-border-fg white
+set -g pane-active-border-fg colour31
 # Inactive pane.
 set -g pane-border-bg default
 set -g pane-border-fg colour17
@@ -162,6 +190,14 @@ setw -g mode-fg white
 # Monitored windows (in reverse video).
 setw -g window-status-alert-bg red
 setw -g window-status-alert-fg white
+# As of tmux 1.6 we can highlight different alerts.
+setw -g window-status-bell-bg colour22
+setw -g window-status-bell-fg white
+setw -g window-status-content-bg colour88
+setw -g window-status-content-fg white
+setw -g window-status-content-attr none
+setw -g window-status-activity-bg red
+setw -g window-status-activity-fg white
 
 ################################################################################
 # Caption settings.