]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - tmux.conf.in
ea82d371f34f5e081f630fa092044f3af13955f9
[config/dotfiles.git] / tmux.conf.in
1 # Tmux configuration file.
2 #
3 # Notes:
4 #
5 # - To swap/renumber windows (like GNU screen's :number command) use
6 #   :swap-window -t <number>.
7
8 # Copyright (C) 2011-2013  Simon Ruderich
9 #
10 # This file is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
14 #
15 # This file is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this file.  If not, see <http://www.gnu.org/licenses/>.
22
23
24 # GENERAL
25
26 # Use Zsh as shell. Tmux does not display a warning if the shell isn't
27 # available!
28 set-option -g default-shell "/bin/zsh"
29
30 # Use a larger window history, in lines.
31 set-option -g history-limit 50000
32
33 # Display Tmux messages for a longer time, in milliseconds.
34 set-option -g display-time 3000
35
36 # Open new windows with the current working directory used when Tmux was
37 # started, and not the working directory of the current pane.
38 set-option -g default-path "."
39
40
41 # TERMINAL
42
43 # Enable 256 color mode.
44 set-option -g default-terminal "screen-256color"
45
46 # Disable alternative screen feature. This way e.g. Vim's window content stays
47 # visible after quitting Vim. This is quite useful to copy data (needs tmux
48 # 1.5 to work (almost) completely).
49 set-window-option -g alternate-screen off
50
51 # Set title for outer terminal.
52 set-option -g set-titles on
53
54 # Don't rename windows to the currently running program, my zshrc does this
55 # for me (with some additional features).
56 set-window-option -g automatic-rename off
57
58
59 # STATUS LINE
60
61 # White text.
62 set-option -g status-fg white
63 # Bright blue background color (colour12).
64 set-option -g status-bg colour12
65
66 # Nothing left of window list.
67 set-option -g status-left ""
68 # Current load average and hostname (#H) on the right.
69 set-option -g status-right "#(uptime | sed 's/^.*load averages*: //; s/,//g') \
70                             #H \
71                             #[] #(~/.shell/bin/battery.pl -t BATTERY)\
72                             "
73
74 # Format for windows in the window list in the status line. #I window index,
75 # #W window number, #F window flags.
76 set-window-option -g window-status-format         "#I #W#F"
77 set-window-option -g window-status-current-format "#I #W#F"
78
79 # Update status line commands (#(..)) only every minute.
80 set-option -g status-interval 60
81
82
83 # BINDINGS
84
85 # Use Vi(m) key bindings.
86 set-option        -g status-keys vi
87 set-window-option -g mode-keys vi
88
89 # Use Ctrl-A as escape binding, like in GNU screen.
90 set-option -g prefix C-a
91 # Ctrl-A a sends Ctrl-A to the process, like in GNU screen.
92 bind-key a send-prefix
93 unbind-key C-b
94
95 # GNU screen like bindings (with C-x).
96 bind-key C-c new-window
97 bind-key C-a last-window
98 bind-key C-n next-window
99 bind-key C-p previous-window
100 bind-key C-[ copy-mode
101 bind-key C-] paste-buffer
102
103 # Arrow-key replacements for tmux's prompt.
104 bind-key -t vi-edit C-n history-down
105 bind-key -t vi-edit C-p history-up
106
107 # Display date/time, similar to GNU screen's ^a ^t. Tmux's default ^a t just
108 # displays the current time, but I often want to know the current date.
109 bind-key C-t display-message
110
111 # Run urlview on the current screen content. Very useful to follow links.
112 # Thanks to Arch wiki (https://wiki.archlinux.org/index.php/Tmux) for the
113 # basic idea how to enable this in tmux.
114 bind-key C-b capture-pane \; \
115              save-buffer ~/.tmp/tmux-urlview \; \
116              new-window "$SHELL -c 'urlview < ~/.tmp/tmux-urlview'"
117
118 # Binding for fast switching to windows 10 to 29 (and more if necessary).
119 # Thanks to Kays in #irssi on Freenode (2012-10-18 16:25 CEST) for reminding
120 # me of this issue in Tmux. See tmux-windows.pl for details how it works.
121 bind-key \; source-file "TMUX_WINDOW_PATH"
122
123 # vim: ft=tmux