a1ea76ddc7ce27f703b3673ae7aa18b799de39a9
[grml-etc-core.git] / etc / tmux.conf
1 # Filename:      /etc/tmux
2 # Purpose:       configuration file for tmux
3 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika at grml.org>,
4 #                Sebastian Boehm <sebastian at sometimesfood.org>
5 #                Bernhard Tittelbach <xro at realraum.at>
6 # Bug-Reports:   see http://grml.org/bugs/
7 # License:       This file is licensed under the GPL v2.
8 ################################################################################
9
10 ### screen-like keybindings
11 unbind C-b
12 set -g prefix C-a
13 bind-key a send-prefix
14 bind-key C-a last-window
15 unbind space
16 bind-key space next-window
17 bind-key C-space next-window
18 bind-key K confirm-before kill-pane
19 bind-key '\' confirm-before kill-session
20 #bind-key C-h previous-window
21
22 ### join the last active pane to the currently active window
23 bind-key j join-pane -s !
24
25 ### join the marked pane to the currently active window
26 ### ('bind-key m select-pane -m' is default to mark the current pane)
27 bind-key J join-pane
28
29 ### Move current window to session named "bg" (and create session if it does not exist)
30 bind-key B if-shell "! tmux has-session -t bg" "new-session -d -s bg" \; move-window -t bg
31
32 ### Reload Config
33 if-shell "! (env | grep -q TMUX=/tmp/tmate)" \
34   "bind-key R source-file ~/.tmux.conf \\; source-file -q ~/.tmux.conf.local \\; display-message '~/.tmux.conf[.local] reloaded'"
35
36 ###rebind keys
37 bind-key h next-layout
38 bind-key BSpace previous-window
39
40 bind-key tab select-pane -t :.+
41 ### useful custom keybindings
42 bind-key | command-prompt -p "exec:" "split-window -h '%%'"
43 bind-key - command-prompt -p "exec:" "split-window -v '%%'"
44
45 ### misc options
46 set -s escape-time 0
47 set -g default-terminal "screen-256color"
48 set -g display-panes-time 3000
49 set -g visual-activity on
50 set -g mode-keys vi
51
52 ### set status line appearance
53 set -g status-style fg=white,bg=black
54
55 set -g status-left-length 28
56 ### status-left:  @hostname:sessionname
57 set -g status-left "#[fg=white]@#h#[fg=red]:#S#[fg=white] |"
58 ### status-left:  username@hostname:sessionname
59 #set -g status-left "#[fg=blue]#(echo ${USER})#[fg=white]@#h#[fg=red]:#S#[fg=white] |"
60
61 ### status-right: Date and Time
62 set -g status-right-length 16
63 set -g status-right '#[fg=yellow]%Y-%m-%d %H:%M'
64 ### status-right: Time
65 #set -g status-right-length 6
66 #set -g status-right "#[fg=yellow]%H:%M"
67
68 set-window-option -g window-status-style fg=blue,bg=black
69 set-window-option -g window-status-current-style bold
70
71 ### source user-specific local configuration file
72 if-shell "! (env | grep -q TMUX=/tmp/tmate)" \
73   "source-file -q ~/.tmux.conf.local"