Show host and session name in tmux status line.
[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 # Ensure KRB5CCNAME is preserved in the environment.
13 set -g update-environment 'DISPLAY WINDOWID SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION KRB5CCNAME'
14
15 # Clock.
16 setw -g clock-mode-colour white
17 setw -g clock-mode-style 24
18
19 ################################################################################
20 # Screen compatibility.
21 ################################################################################
22 set -g prefix C-p
23 unbind C-b
24 bind C-p last-window
25 bind C-l refresh-client
26 bind l refresh-client
27 bind S split-window -v
28 bind | split-window -h
29 bind C-[ copy-mode
30 bind ] paste-buffer
31 bind C-] paste-buffer
32 bind _ setw monitor-activity
33 bind * list-clients
34 bind < command-prompt -p "Load buffer from file:" 'load-buffer %1'
35 bind > command-prompt -p "Save buffer to file:" 'save-buffer %1'
36
37 ################################################################################
38 # Hotkeys.
39 ################################################################################
40 # Up and down like Vim.
41 bind j select-pane -D
42 bind C-j select-pane -D
43 bind k select-pane -U
44 bind C-k select-pane -U
45 # Previous and next window kinda like Vim.
46 bind h previous-window
47 bind C-h previous-window
48 bind l next-window
49 bind C-l next-window
50 # And for panes.
51 bind H select-pane -L
52 bind L select-pane -R
53 # Top and bottom.
54 bind J select-pane -t bottom
55 bind K select-pane -t top
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 -t %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