support MacOS
[~madcoder/dotfiles.git] / tmux.conf
1 # set the prefix to ^G
2
3 set  -g default-terminal screen-256color
4 set  -g history-limit 100000
5 set  -g mouse-select-pane on
6 set  -g mouse-resize-pane on
7 set -wg mode-mouse on
8 set  -g mouse-utf8 on
9 set -wg xterm-keys       1
10 set  -g status-keys     vi
11 set -wg mode-keys       vi
12 set  -s escape-time    100
13
14 unbind C-b
15 set -g prefix C-g
16 bind g   send-prefix
17 bind C-g send-prefix
18
19 bind -n F5 source ~/.tmux.conf
20 bind -n M-x command-prompt
21
22 bind d detach
23 bind -n C-\ detach
24 bind -n C-up    resize-pane -U
25 bind -n C-down  resize-pane -D
26 bind -n C-left  resize-pane -L
27 bind -n C-right resize-pane -R
28
29 bind n   next-window
30 bind C-n next-window
31 bind p   previous-window
32 bind C-p previous-window
33 bind s   command-prompt "split-window -v '%%'"
34 bind S   command-prompt "split-window -v '%%'"
35 bind v   command-prompt "split-window -h '%%'"
36 bind C-v command-prompt "split-window -h '%%'"
37
38 bind Enter new-window
39 bind r command-prompt "new-window '%%'"
40 bind c confirm-before kill-pane
41 bind x confirm-before kill-pane
42 bind ! command-prompt -p Man: "split-window 'man %%'"
43 bind o break-pane
44
45 bind h select-pane -L
46 bind k select-pane -U
47 bind j select-pane -D
48 bind l select-pane -R
49 bind K swap-pane -U
50 bind J swap-pane -D
51 bind i display-message \; display-panes
52 set  -g display-panes-time 1500
53 set  -g display-time       1500
54
55 set  -g base-index 1
56 bind Tab choose-window
57 bind 1 select-window -t 1
58 bind 2 select-window -t 2
59 bind 3 select-window -t 3
60 bind 4 select-window -t 4
61 bind 5 select-window -t 5
62 bind 6 select-window -t 6
63 bind 7 select-window -t 7
64 bind 8 select-window -t 8
65 bind 9 select-window -t 9
66 bind 0 select-window -t 10
67
68 ##############################################################################
69 # Copy Mode
70 bind Escape copy-mode
71 bind C-' ' copy-mode
72 bind    -t vi-copy C-u    page-up
73 bind    -t vi-copy C-d    page-down
74 bind    -t vi-copy G      bottom-line
75 bind -n -t vi-copy Escape cancel
76 bind -n -t vi-copy |      start-of-line
77
78 bind - run-shell     "tmux show-buffer | xclip"
79 bind = choose-buffer "run-shell 'tmux show-buffer -b %% | xclip'"
80
81 ##############################################################################
82 # Edit mode
83 bind -n -t vi-edit Escape switch-mode
84 bind -n -t vi-edit Up     history-up
85 bind -n -t vi-edit Down   history-down
86 bind -n -t vi-edit Left   cursor-left
87 bind -n -t vi-edit Right  cursor-right
88 bind -n -t vi-edit C-u    delete-line
89 bind -n -t vi-edit C-k    delete-end-of-line
90
91 bind -c -t vi-edit Escape cancel
92 bind -c -t vi-edit |      start-of-line
93
94 ##############################################################################
95 # Bells
96 set  -g visual-activity  on
97 set  -g visual-bell      off
98 set  -g bell-action      any
99 set -wg monitor-activity off
100
101 ##############################################################################
102 # Theme
103 set  -g status         on
104 set  -g status-attr    default
105 set  -g status-fg      white
106 set  -g status-bg      default
107 set  -g status-justify centre
108 set  -g status-utf8    on
109
110 set  -g status-left    "#[fg=green][ #[fg=blue,bold]%H:%M #[fg=green,nobold]]["
111 set  -g status-right   "#[fg=green]][ #[fg=blue,bold]#(cut -d' ' -f1-3 /proc/loadavg) #[fg=green,nobold]]"
112
113 # command/message line colors
114 set -g message-fg   white
115 set -g message-bg   red
116 set -g message-attr bright
117
118 # default window title colors
119 set -wg window-status-fg   white
120 set -wg window-status-bg   default
121 set -wg window-status-attr dim
122
123 set -wg window-status-format         '#I #W#F'
124 set -wg window-status-current-format '#[fg=red,nobold][#[fg=white,bold]#I #W#F#[fg=red,nobold]]'
125
126 set -g pane-border-bg default
127 set -g pane-border-fg default
128 set -g pane-active-border-bg default
129 set -g pane-active-border-fg red
130
131 # active window title colors
132 set -wg window-status-current-fg   white
133 set -wg window-status-current-bg   default
134 set -wg window-status-current-attr bright