3345bd02e4da077c010dc202beb65d571e66119d
[profile.git] / .tmux.conf
1 ################################################################################
2 # Options.
3 ################################################################################
4 # Use vi keys for scrolling etc.
5 # Use lsk -t vi|emacs-<table> to see binds in table choice, copy or edit.
6 setw -g mode-keys vi
7 set -g status-keys vi
8
9 # Don't wait so long to parse escape sequences.
10 set -s escape-time 100
11
12 # Clock.
13 setw -g clock-mode-colour white
14 setw -g clock-mode-style 24
15
16 # Scrollback buffer.
17 set -g history-limit 4096
18
19 # Don't use the mouse to select text by default.
20 # It has two important flaws.  Double-clicking to select a word doesn't work.
21 # Middle clicking to paste doesn't work.
22 set -g mouse-resize-pane off
23 set -g mouse-select-pane off
24 set -g mouse-select-window off
25 set -g mode-mouse off
26
27 ################################################################################
28 # Screen compatibility.
29 ################################################################################
30 set -g prefix C-p
31 unbind C-b
32 bind C-p last-window
33 bind p send-keys C-p
34 bind C-l refresh-client
35 bind l refresh-client
36 bind S split-window -v
37 bind | split-window -h
38 bind C-[ copy-mode
39 bind ] paste-buffer
40 bind C-] paste-buffer
41 bind _ setw monitor-activity
42 bind * list-clients
43 bind < command-prompt -p "Load buffer from file:" 'load-buffer %1'
44 bind > command-prompt -p "Save buffer to file:" 'save-buffer %1'
45
46 ################################################################################
47 # Hotkeys.
48 ################################################################################
49 # Up and down like Vim.
50 bind j select-pane -D
51 bind C-j select-pane -D
52 bind k select-pane -U
53 bind C-k select-pane -U
54 # Previous and next panes kinda like Vim.
55 bind h select-pane -L
56 bind C-h select-pane -L
57 bind l select-pane -R
58 bind C-l select-pane -R
59 # And for windows.
60 bind H previous-window
61 bind L next-window
62 # Last window like Vim.
63 bind ^ last-window
64 bind C-^ last-pane
65 # Top and bottom.
66 bind J select-pane -D
67 bind K select-pane -U
68 # Swap panes.
69 bind o swap-pane -D
70 bind C-o swap-pane -D
71 bind O swap-pane -U
72 bind w command-prompt -p "Select [<window>.]<pane> to swap:" 'swap-pane -s . -t %1'
73 # Swap windows.
74 bind W choose-window "swap-window -t '%%'"
75 # Show panes.
76 bind = display-panes
77 # Move the current pane into a separate window.
78 bind b break-pane
79 # Split another pane into this window.
80 bind B command-prompt -p "Select <window>[.<pane>] to join:" 'join-pane -s %1'
81 # Split vertically.
82 bind C-\ split-window -v
83 # Next pane.
84 bind i select-pane -t :.+
85 bind C-i select-pane -t :.+
86 bind I select-pane -t :.-
87 # Layouts.
88 bind . select-layout even-vertical
89 bind , select-layout tiled
90 # Simulate maximising the window.
91 bind / select-layout even-vertical \; swap-pane -s top \; resize-pane -D 9999
92 # Select windows.
93 bind - choose-window
94 bind M-0 select-window -t 10
95 bind M-1 select-window -t 11
96 bind M-2 select-window -t 12
97 bind M-3 select-window -t 13
98 bind M-4 select-window -t 14
99 bind M-5 select-window -t 15
100 bind M-6 select-window -t 16
101 bind M-7 select-window -t 17
102 bind M-8 select-window -t 18
103 bind M-9 select-window -t 19
104 # Set current window title.
105 bind t command-prompt -p "Set window's title to:" 'rename-window %1'
106 # Show clock.
107 bind T clock-mode
108 # Monitor window for a particular string.
109 bind m command-prompt -p "Monitor:" 'setw monitor-content %1'
110 bind M setw monitor-content ""
111 # Synchronise input.
112 bind \; setw synchronize-panes
113 # Choose buffer to paste.
114 bind } choose-buffer 'paste-buffer -b %%'
115 # Enter copy-mode and scroll up.
116 bind { copy-mode -u
117 # Choose buffer to show.
118 # XXX: As of tmux 1.3 this doesn't work.
119 #bind '"' choose-buffer 'show-buffer -b %%'
120 bind '"' list-buffers \; command-prompt -p "Choose buffer to show:" 'show-buffer -b %1'
121 bind "'" show-buffer
122 # Toggle mouse mode as it is useful despite the flaws listed above.
123 bind C-m set -g mouse-resize-pane \; set -g mouse-select-pane \; set -g mouse-select-window \; set -g mode-mouse
124
125 ################################################################################
126 # Fix missing binds in Vi modes.
127 ################################################################################
128 # Command prompt.
129 bind -t vi-edit C-u delete-line
130 # We can't delete a word so ^w can clear the whole line for now.
131 bind -t vi-edit C-w delete-line
132 bind -t vi-edit Up history-up
133 bind -t vi-edit Down history-down
134 bind -t vi-edit Left cursor-left
135 bind -t vi-edit Right cursor-right
136 # Copy mode.
137 bind -t vi-copy y copy-selection
138
139 ################################################################################
140 # Terminal settings.
141 ################################################################################
142 set -g default-terminal 'screen-256color'
143 # PuTTY needs help to set bold colours.
144 set -a -g terminal-overrides ',putty-256color:C8:Ms=\\E]52;%p1%s;%p2%s\\007m'
145
146 ################################################################################
147 # Window and pane settings.
148 ################################################################################
149 set -g display-panes-time 1000
150 set -g display-panes-active-colour white
151 set -g display-panes-colour colour17
152 # Command entry.
153 set -g message-bg colour90
154 set -g message-fg white
155 # Active pane
156 set -g pane-active-border-bg default
157 set -g pane-active-border-fg white
158 # Inactive pane.
159 set -g pane-border-bg default
160 set -g pane-border-fg colour17
161 # Messages.
162 setw -g mode-bg blue
163 setw -g mode-fg white
164 # Monitored windows (in reverse video).
165 setw -g window-status-alert-bg red
166 setw -g window-status-alert-fg white
167
168 ################################################################################
169 # Caption settings.
170 ################################################################################
171 # Don't update the title bar.
172 set -g set-titles off
173 # Status line black on white.
174 set -g status-attr none
175 set -g status-bg white
176 set -g status-fg black
177 # Current window white on blue.
178 setw -g window-status-current-attr none
179 setw -g window-status-current-bg colour17
180 setw -g window-status-current-fg white
181 # No border.
182 set -g status-left ''
183 set -g status-right '#[fg=white,bg=colour8][#H:#S]'
184 # Window flags.
185 setw -g window-status-current-format '[#I.#P#F #W]'
186 setw -g window-status-format ' #I.#P#F #W '
187 # Don't set window name.  XXX: Issue with PROMPT_COMMAND.
188 #setw -g automatic-rename off