-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
113 lines (89 loc) · 4.46 KB
/
tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set -g default-terminal "screen-256color"
set-option -g status-style bg=colour235,fg=colour136,default # bg=base02, fg=yellow
# C-b is not acceptable -- Vim uses it
unbind C-a
set-option -g prefix C-x
# set window split
bind - split-window -v
bind | split-window -h
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
bind X kill-window
bind Q confirm-before -p "kill-session #S? (y/n)" kill-session
bind-key x kill-pane
# Hide status bar on demand
bind C-s if -F '#{s/off//:status}' 'set status off' 'set status on'
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# Selecting next pane using "Tab"
# -r is to enable repeat of command without need for pressing prefix again
# Tab is repeatable, within repeat-time (ms) delay...
bind-key -r Tab select-pane -t :.+
# switch pane
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Toggle mouse on with ^a m
bind m \
set -g mouse on \;\
display 'Mouse: ON'
# Toggle mouse off with ^a M
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
# default window title colors
set-window-option -g window-status-style fg=colour244,bg=default,dim # fg=base0
# active window title colors
set-window-option -g window-status-current-style fg=colour166,bg=default,bright # fg=orange
# pane border
#set-option -g pane-border-style fg=colour235 #fg=base02
#set-option -g pane-active-border-style fg=colour240 #fg=base01
set-option -g pane-border-style fg=green
set-option -g pane-active-border-style fg=white
# message text
set-option -g message-style bg=colour235,fg=colour166 # bg=base02, fg=orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour green #green
set -g status-interval 1
set -g status-justify centre # center align window list
set -g status-left-length 20
set -g status-right-length 140
set -g status-left '#[fg=green]#H #[fg=black]• #[fg=green,bright]#(uname -r | cut -c 1-6)#[default]'
set -g status-right '#[fg=green,bg=default,bright]#(tmux-mem-cpu-load) #[fg=red,dim,bg=default]#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[fg=white,bg=default]%a%l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d'
# Start numbering at 1
set -g base-index 1
# Allows for faster key repetition
set -s escape-time 0
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on
# auto window rename
set-window-option -g automatic-rename
# https://github.com/edkolev/dots/blob/master/tmux.conf
# Updates for tmux 1.9's current pane splitting paths.
# from powerline
run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')"
run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')"
# Vi copypaste mode
set-window-option -g mode-keys vi
# Use vim keybindings in copy mode
setw -g mode-keys vi
# rm mouse mode fail
#if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 1\)' 'set -g mouse off'
#if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 1\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set -g mode-mouse off'
# fix pane_current_path on new window and splits
if-shell "test '#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)'" 'unbind c; bind c new-window -c "#{pane_current_path}"'
if-shell "test '#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)'" "unbind '\"'; bind '\"' split-window -v -c '#{pane_current_path}'"
if-shell "test '#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)'" 'unbind v; bind v split-window -h -c "#{pane_current_path}"'
if-shell "test '#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)'" 'unbind %; bind % split-window -h -c "#{pane_current_path}"'
# key bindings
# bind-key [-nr] [-T key-table] key command [arguments]
# By default (without -T), the key is bound in the prefix key table. The -r flag indicates this key may repeat, see the repeat-time option