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