-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
214 lines (165 loc) · 5.74 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
set -g prefix C-Space
unbind C-b
bind C-Space send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# quick pane cycling
unbind ^Space
bind ^Space select-pane -t :.+
# improve colors
set -g default-terminal 'screen-256color'
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# set -g prefix2 C-b
set -g prefix2 C-s
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# soften status bar color from harsh green to light gray
set -g status-style bg='#666666',fg='#aaaaaa'
# remove administrative debris (session name, hostname, time) in status bar
set -g status-left ''
set -g status-right ''
# increase scrollback lines
set -g history-limit 10000
# prefix -> back-one-character
bind-key C-b send-prefix
# prefix-2 -> forward-incremental-history-search
bind-key C-s send-prefix -2
# don't suspend-client
unbind-key C-z
# Local config
if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'
# split panes using | and -
bind \ split-window -h
bind - split-window -v
# unbind '"'
# unbind %
## reload config file (change file location to your the tmux.conf you want to use)
# bind r source-file ~/.tmux.conf
## switch panes using Alt-arrow without prefix
# bind -n M-Left select-pane -L
# bind -n M-Right select-pane -R
# bind -n M-Up select-pane -U
# bind -n M-Down select-pane -D
# ######################
# ### DESIGN CHANGES ###
# ######################
## panes
# set -g pane-border-fg black
# set -g pane-active-border-fg brightred
## Status bar design
## status line
# set -g status-utf8 on
# set -g status-justify left
# set -g status-bg default
# set -g status-fg colour12
# set -g status-interval 2
## messaging
# set -g message-fg black
# set -g message-bg yellow
# set -g message-command-fg blue
# set -g message-command-bg black
## window mode
# setw -g mode-bg colour6
# setw -g mode-fg colour0
## Info on left (I don't have a session display for now)
# set -g status-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
# set -g default-terminal "screen-256color"
setw -g xterm-keys on
set -s escape-time 10 # faster command sequences
set -sg repeat-time 600 # increase repeat timeout
set -s focus-events on
## The modes
# setw -g clock-mode-colour colour135
# setw -g mode-attr bold
# setw -g mode-fg colour196
# setw -g mode-bg colour238
## TPM
set -g @tpm_plugins " \
plugins/tpm \
plugins/tmux-sensible \
plugins/tmux-copycat \
plugins/tmux-yank \
plugins/tmux-open \
plugins/tmux-battery \
"
run-shell ~/.tmux/plugins/tpm/tpm
run-shell ~/.tmux/plugins/tmux-sensible/sensible.tmux
run-shell ~/.tmux/plugins/tmux-copycat/copycat.tmux
run-shell ~/.tmux/plugins/tmux-yank/yank.tmux
run-shell ~/.tmux/plugins/tmux-open/open.tmux
run-shell ~/.tmux/plugins/tmux-battery/battery.tmux
## Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# toggle mouse
bind m run "cut -c3- ~/.tmux.conf | sh -s _toggle_mouse"
## Local config
if-shell "[ -f ~/.tmux.conf.user ]" 'source ~/.tmux.conf.user'
##source-file ~/.tmux/themes/monokai.conf
source-file ~/.tmux/themes/solarized-dark.conf
## Reload tmux config
bind r source-file ~/.tmux.conf
# clock
set-window-option -g clock-mode-colour colour64 #green
set -g @plugin 'seebi/tmux-colors-solarized'
set -g @colors-solarized 'dark'
# Status update interval.
set -g status-interval 60
# Make the window list appear at the left-hand side instead of at the center.
set -g status-justify left
# automatic resize tmux panes
set-hook -g after-kill-pane 'select-layout even-horizontal'
set-hook -g pane-exited 'select-layout even-horizontal'
# copy to Mac OSX clipboard
if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
# copy to X11 clipboard
if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"'
if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"'
# copy to Windows clipboard
if -b 'command -v clip.exe > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | clip.exe"'
if -b '[ -c /dev/clipboard ]' 'bind y run -b "tmux save-buffer - > /dev/clipboard"'
# maximize current pane
bind + run 'cut -c3- ~/.tmux.conf | sh -s _maximize_pane #{session_name} #D'
# clear both screen and history
bind -n C-l send-keys C-l \; run 'sleep 0.05 && tmux clear-history'
# activity
set -g monitor-activity on
set -g visual-activity off
# new window retains current path, possible values are:
# - true
# - false (default)
tmux_conf_new_window_retain_current_path=false
# new pane retains current path, possible values are:
# - true (default)
# - false
tmux_conf_new_pane_retain_current_path=true
# new pane tries to reconnect ssh sessions (experimental), possible values are:
# - true
# - false (default)
tmux_conf_new_pane_reconnect_ssh=false
# prompt for session name when creating a new session, possible values are:
# - true
# - false (default)
tmux_conf_new_session_prompt=false
# highlight focused pane (tmux >= 2.1), possible values are:
# - true
# - false (default)
tmux_conf_theme_highlight_focused_pane=false
if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
run '~/.tmux/plugins/tpm/tpm'