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