76a9eb34403a9590359c0edd7edbda8a1893ea3f
[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 ################################################################################
17 # Screen compatibility.
18 ################################################################################
19 set -g prefix C-p
20 unbind C-b
21 bind C-p last-window
22 bind p send-keys C-p
23 bind C-l refresh-client
24 bind l refresh-client
25 bind S split-window -v
26 bind | split-window -h
27 bind C-[ copy-mode
28 bind ] paste-buffer
29 bind C-] paste-buffer
30 bind _ setw monitor-activity
31 bind * list-clients
32 bind < command-prompt -p "Load buffer from file:" 'load-buffer %1'
33 bind > command-prompt -p "Save buffer to file:" 'save-buffer %1'
34
35 ################################################################################
36 # Hotkeys.
37 ################################################################################
38 # Up and down like Vim.
39 bind j select-pane -D
40 bind C-j select-pane -D
41 bind k select-pane -U
42 bind C-k select-pane -U
43 # Previous and next panes kinda like Vim.
44 bind h select-pane -L
45 bind C-h select-pane -L
46 bind l select-pane -R
47 bind C-l select-pane -R
48 # And for windows.
49 bind H previous-window
50 bind L next-window
51 # Last window like Vim.
52 bind ^ last-window
53 bind C-^ last-pane
54 # Top and bottom.
55 bind J select-pane -D
56 bind K select-pane -U
57 # Swap panes.
58 bind w swap-pane
59 # Show panes.
60 bind = display-panes
61 # Move the current pane into a separate window.
62 bind b break-pane
63 # Split another pane into this window.
64 bind B command-prompt -p "Select [<window>.]<pane> to join:" 'join-pane -s %1'
65 # Next pane.
66 bind i select-pane -t :.+
67 bind C-i select-pane -t :.+
68 bind I select-pane -t :.-
69 # Layouts.
70 bind . select-layout even-vertical
71 bind , select-layout tiled
72 # Simulate maximising the window.
73 bind / select-layout even-vertical \; swap-pane -s top \; resize-pane -D 9999
74 # Show windows
75 bind - list-windows
76 # Set current window title.
77 bind t command-prompt -p "Set window's title to:" 'rename-window %1'
78 # Show clock.
79 bind T clock-mode
80 # Monitor window for a particular string.
81 bind m command-prompt -p "Monitor:" 'setw monitor-content %1'
82 bind M setw monitor-content ""
83 # Synchronise input.
84 bind \; setw synchronize-panes
85 # Choose buffer to paste.
86 bind } choose-buffer 'paste-buffer -b %%'
87 # Enter copy-mode and scroll up.
88 bind { copy-mode -u
89 # Choose buffer to show.
90 # XXX: As of tmux 1.3 this doesn't work.
91 #bind '"' choose-buffer 'show-buffer -b %%'
92 bind '"' list-buffers \; command-prompt -p "Choose buffer to show:" 'show-buffer -b %1'
93 bind "'" show-buffer
94
95 ################################################################################
96 # Fix missing binds in Vi modes.
97 ################################################################################
98 # Command prompt.
99 bind -t vi-edit C-u delete-line
100 # We can't delete a word so ^w can clear the whole line for now.
101 bind -t vi-edit C-w delete-line
102 bind -t vi-edit Up history-up
103 bind -t vi-edit Down history-down
104 bind -t vi-edit Left cursor-left
105 bind -t vi-edit Right cursor-right
106 # Copy mode.
107 bind -t vi-copy y copy-selection
108
109 ################################################################################
110 # Terminal settings.
111 ################################################################################
112 set -g default-terminal 'screen-256color'
113 # PuTTY needs help to set bold colours.
114 set -g terminal-overrides 'putty-256color:C8'
115
116 ################################################################################
117 # Window and pane settings.
118 ################################################################################
119 set -g display-panes-time 1000
120 set -g display-panes-active-colour white
121 set -g display-panes-colour colour17
122 # Command entry.
123 set -g message-bg colour90
124 set -g message-fg white
125 # Active pane
126 set -g pane-active-border-bg default
127 set -g pane-active-border-fg white
128 # Inactive pane.
129 set -g pane-border-bg default
130 set -g pane-border-fg colour17
131 # Messages.
132 setw -g mode-bg blue
133 setw -g mode-fg white
134 # Monitored windows (in reverse video).
135 setw -g window-status-alert-bg red
136 setw -g window-status-alert-fg white
137
138 ################################################################################
139 # Caption settings.
140 ################################################################################
141 # Don't update the title bar.
142 set -g set-titles off
143 # Status line black on white.
144 set -g status-attr none
145 set -g status-bg white
146 set -g status-fg black
147 # Current window white on blue.
148 setw -g window-status-current-attr none
149 setw -g window-status-current-bg colour17
150 setw -g window-status-current-fg white
151 # No border.
152 set -g status-left ''
153 set -g status-right '#[fg=white,bg=colour8][#H:#S]'
154 # Window flags.
155 setw -g window-status-current-format '[#I.#P#F #W]'
156 setw -g window-status-format ' #I.#P#F #W '
157 # Don't set window name.  XXX: Issue with PROMPT_COMMAND.
158 #setw -g automatic-rename off