d85e935e82d1ba639a217c07e8dded296ce56d34
[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 w swap-pane
70 # Show panes.
71 bind = display-panes
72 # Move the current pane into a separate window.
73 bind b break-pane
74 # Split another pane into this window.
75 bind B command-prompt -p "Select [<window>.]<pane> to join:" 'join-pane -s %1'
76 # Split vertically.
77 bind C-\ split-window -v
78 # Next pane.
79 bind i select-pane -t :.+
80 bind C-i select-pane -t :.+
81 bind I select-pane -t :.-
82 # Layouts.
83 bind . select-layout even-vertical
84 bind , select-layout tiled
85 # Simulate maximising the window.
86 bind / select-layout even-vertical \; swap-pane -s top \; resize-pane -D 9999
87 # Show windows
88 bind - list-windows
89 # Set current window title.
90 bind t command-prompt -p "Set window's title to:" 'rename-window %1'
91 # Show clock.
92 bind T clock-mode
93 # Monitor window for a particular string.
94 bind m command-prompt -p "Monitor:" 'setw monitor-content %1'
95 bind M setw monitor-content ""
96 # Synchronise input.
97 bind \; setw synchronize-panes
98 # Choose buffer to paste.
99 bind } choose-buffer 'paste-buffer -b %%'
100 # Enter copy-mode and scroll up.
101 bind { copy-mode -u
102 # Choose buffer to show.
103 # XXX: As of tmux 1.3 this doesn't work.
104 #bind '"' choose-buffer 'show-buffer -b %%'
105 bind '"' list-buffers \; command-prompt -p "Choose buffer to show:" 'show-buffer -b %1'
106 bind "'" show-buffer
107 # Toggle mouse mode as it is useful despite the flaws listed above.
108 bind C-m set -g mouse-resize-pane \; set -g mouse-select-pane \; set -g mouse-select-window \; set -g mode-mouse
109
110 ################################################################################
111 # Fix missing binds in Vi modes.
112 ################################################################################
113 # Command prompt.
114 bind -t vi-edit C-u delete-line
115 # We can't delete a word so ^w can clear the whole line for now.
116 bind -t vi-edit C-w delete-line
117 bind -t vi-edit Up history-up
118 bind -t vi-edit Down history-down
119 bind -t vi-edit Left cursor-left
120 bind -t vi-edit Right cursor-right
121 # Copy mode.
122 bind -t vi-copy y copy-selection
123
124 ################################################################################
125 # Terminal settings.
126 ################################################################################
127 set -g default-terminal 'screen-256color'
128 # PuTTY needs help to set bold colours.
129 set -a -g terminal-overrides ',putty-256color:C8:Ms=\\E]52;%p1%s;%p2%s\\007m'
130
131 ################################################################################
132 # Window and pane settings.
133 ################################################################################
134 set -g display-panes-time 1000
135 set -g display-panes-active-colour white
136 set -g display-panes-colour colour17
137 # Command entry.
138 set -g message-bg colour90
139 set -g message-fg white
140 # Active pane
141 set -g pane-active-border-bg default
142 set -g pane-active-border-fg white
143 # Inactive pane.
144 set -g pane-border-bg default
145 set -g pane-border-fg colour17
146 # Messages.
147 setw -g mode-bg blue
148 setw -g mode-fg white
149 # Monitored windows (in reverse video).
150 setw -g window-status-alert-bg red
151 setw -g window-status-alert-fg white
152
153 ################################################################################
154 # Caption settings.
155 ################################################################################
156 # Don't update the title bar.
157 set -g set-titles off
158 # Status line black on white.
159 set -g status-attr none
160 set -g status-bg white
161 set -g status-fg black
162 # Current window white on blue.
163 setw -g window-status-current-attr none
164 setw -g window-status-current-bg colour17
165 setw -g window-status-current-fg white
166 # No border.
167 set -g status-left ''
168 set -g status-right '#[fg=white,bg=colour8][#H:#S]'
169 # Window flags.
170 setw -g window-status-current-format '[#I.#P#F #W]'
171 setw -g window-status-format ' #I.#P#F #W '
172 # Don't set window name.  XXX: Issue with PROMPT_COMMAND.
173 #setw -g automatic-rename off