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