-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
139 lines (104 loc) · 3.55 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
###########################
# Configuration
###########################
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
# increase scroll-back history
set -g history-limit 5000
# use vim key bindings
setw -g mode-keys vi
# decrease command delay (increases vim responsiveness)
set -sg escape-time 1
# increase repeat time for repeatable commands
set -g repeat-time 1000
# start window index at 1
set -g base-index 1
# start pane index at 1
setw -g pane-base-index 1
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
# re-number windows when one is closed
set -g renumber-windows on
# enable pbcopy and pbpaste
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/blob/master/README.md
#set-option -g default-command "reattach-to-user-namespace -l zsh"
###########################
# Key Bindings
###########################
# tmux prefix
unbind C-b
set -g prefix `
bind-key ` send-prefix
# copy with 'enter' or 'y' and send to mac os clipboard: http://goo.gl/2Bfn8
#unbind -t vi-copy Enter
#bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
#bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# paste
unbind C-p
bind C-p paste-buffer
# window splitting
unbind %
bind | split-window -h
unbind '"'
bind - split-window -v
# quickly switch panes
unbind ^J
bind ^J select-pane -t :.+
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
#bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
#bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
#bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
#bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
#bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
######################
### DESIGN CHANGES ###
######################
# set refresh interval for status bar
set -g status-interval 30
## center the status bar
set -g status-justify left
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
# The modes {
setw -g clock-mode-colour red
setw -g mode-style bg=red,fg=red,bold
# }
# The panes {
set -g pane-border-style bg=default,fg=cyan
set -g pane-active-border-style bg=default,fg=cyan
# }
# The statusbar {
set -g status-position bottom
set -g status-bg default # the entire bar at the bottom
set -g status-fg blue
set -g status-style dim
set -g status-left ''
set -g status-left-length 20
# status_right {
set -g status-right-length 50
## show sesion name [ | SSH_HOST 123ms ]
set -g status-right '#S #([[ -z "${SSH_HOST}" ]] && echo "| $HOSTNAME $(echo "$SSH_CLIENT" | cut -d" " -f1 | xargs ping -c1 | tail -1 | cut -d" " -f4 | cut -d"/" -f1)ms" || echo "")'
## show hostname, date, time, and battery in right status bar
#set-option -g status-right '#[fg=green]#H#[default] %m/%d/%y %I:%M' #\
##[fg=red]#(battery discharging)#[default]#(battery charging)'
# }
# The current window in the status bar
setw -g window-status-current-format ' #I:#W#F '
setw -g window-status-current-style bg=default,fg=blue,bold
# The active window's background
setw -g window-status-format ' #I:#W#F '
setw -g window-status-style bg=default,fg=white,bright
setw -g window-status-bell-style bg=red,fg=red,bold
# }
# The messages {
set -g message-style bg=red,fg=white,bold
# }