]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - tmux.conf.in
tmux.conf: Add note how to swap/renumber windows.
[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-2012  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 a larger window history, in lines.
27 set-option -g history-limit 10000
28
29 # Display messages for three seconds.
30 set-option -g display-time 3000
31
32 # Open new windows with the current working directory used when Tmux was
33 # started, and not the working directory of the current pane.
34 set-option -g default-path "."
35
36
37 # TERMINAL
38
39 # Disable alternative screen feature. This way e.g. Vim's window content stays
40 # visible after quitting Vim. This is quite useful to copy data (needs tmux
41 # 1.5 to work (almost) completely).
42 set-window-option -g alternate-screen off
43
44 # Set title for outer terminal.
45 set-option -g set-titles on
46
47 # Don't rename windows to the currently running program, my zshrc does this
48 # for me (with some additional features).
49 set-window-option -g automatic-rename off
50
51
52 # STATUS LINE
53
54 # White text.
55 set-option -g status-fg white
56 # Bright blue background color (colour12).
57 set-option -g status-bg colour12
58
59 # Nothing left of window list.
60 set-option -g status-left ""
61 # Current load average and hostname on the right.
62 set-option -g status-right "#(uptime | sed 's/^.*load averages*: //; s/,//g') \
63                             #H"
64
65 # Format for windows in the window list in the status line. #I window index,
66 # #W window number, #F window flags.
67 set-window-option -g window-status-format         "#I #W#F"
68 set-window-option -g window-status-current-format "#I #W#F"
69
70 # Update status line commands (#(..)) only every minute.
71 set-option -g status-interval 60
72
73
74 # BINDINGS
75
76 # Use Vi(m) key bindings.
77 set-option        -g status-keys vi
78 set-window-option -g mode-keys vi
79
80 # Use Ctrl-A as escape binding, like in GNU screen.
81 set-option -g prefix C-a
82 # Ctrl-A a sends Ctrl-A to the process, like in GNU screen.
83 bind-key a send-prefix
84 unbind-key C-b
85
86 # GNU screen like bindings (with C-x).
87 bind-key C-c new-window
88 bind-key C-a last-window
89 bind-key C-n next-window
90 bind-key C-p previous-window
91 bind-key C-[ copy-mode
92 bind-key C-] paste-buffer
93
94 # Arrow-key replacements for tmux's prompt.
95 bind-key -t vi-edit C-n history-down
96 bind-key -t vi-edit C-p history-up
97
98 # Display date/time, similar to GNU screen's ^a ^t. Tmux's default ^a t just
99 # displays the current time, but I often want to know the current date.
100 bind-key C-t display-message
101
102 # Run urlview on the current screen content. Very useful to follow links.
103 # Thanks to Arch wiki (https://wiki.archlinux.org/index.php/Tmux) for the
104 # basic idea.
105 bind-key C-b capture-pane \; \
106              save-buffer ~/.tmp/tmux-urlview \; \
107              new-window "$SHELL -c 'urlview < ~/.tmp/tmux-urlview'"
108
109 # vim: ft=tmux