]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - tmux.conf.in
screenrc,tmux.conf: Display CPU temperature.
[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/temperature.pl -t TEMPERATURE)\
72                             #[] #(~/.shell/bin/battery.pl -t BATTERY)\
73                             "
74
75 # Format for windows in the window list in the status line. #I window index,
76 # #W window number, #F window flags.
77 set-window-option -g window-status-format         "#I #W#F"
78 set-window-option -g window-status-current-format "#I #W#F"
79
80 # Update status line commands (#(..)) only every minute.
81 set-option -g status-interval 60
82
83
84 # BINDINGS
85
86 # Use Vi(m) key bindings.
87 set-option        -g status-keys vi
88 set-window-option -g mode-keys vi
89
90 # Use Ctrl-A as escape binding, like in GNU screen.
91 set-option -g prefix C-a
92 # Ctrl-A a sends Ctrl-A to the process, like in GNU screen.
93 bind-key a send-prefix
94 unbind-key C-b
95
96 # GNU screen like bindings (with C-x).
97 bind-key C-c new-window
98 bind-key C-a last-window
99 bind-key C-n next-window
100 bind-key C-p previous-window
101 bind-key C-[ copy-mode
102 bind-key C-] paste-buffer
103
104 # Arrow-key replacements for tmux's prompt.
105 bind-key -t vi-edit C-n history-down
106 bind-key -t vi-edit C-p history-up
107
108 # Display date/time, similar to GNU screen's ^a ^t. Tmux's default ^a t just
109 # displays the current time, but I often want to know the current date.
110 bind-key C-t display-message
111
112 # Run urlview on the current screen content. Very useful to follow links.
113 # Thanks to Arch wiki (https://wiki.archlinux.org/index.php/Tmux) for the
114 # basic idea how to enable this in tmux.
115 bind-key C-b capture-pane \; \
116              save-buffer ~/.tmp/tmux-urlview \; \
117              new-window "$SHELL -c 'urlview < ~/.tmp/tmux-urlview'"
118
119 # Binding for fast switching to windows 10 to 29 (and more if necessary).
120 # Thanks to Kays in #irssi on Freenode (2012-10-18 16:25 CEST) for reminding
121 # me of this issue in Tmux. See tmux-windows.pl for details how it works.
122 bind-key \; source-file "TMUX_WINDOW_PATH"
123
124 # vim: ft=tmux