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