-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
204 lines (154 loc) · 5.96 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
################################################
# Options:
# - Session options (set-option [-g])
# - Window options (set-window-option [-g])
# - help: https://tmuxcheatsheet.com
#################################################
# ======================================================================================================================
# General
# ======================================================================================================================
# {{{
# start windows numbering at 1
set-option -g base-index 1
# make pane numbering consistent with windows
set-option -g pane-base-index 1
# rename window to reflect current program
set-option -g automatic-rename on
# renumber windows when a window is closed
set-option -g renumber-windows on
# Key binding in the status line (bind-key :) vi or emacs
set-option -g status-keys vi
# indicate modifiers such as Shift, Alt or Ctrl
set-option -g xterm-keys on
# close mouse model
set-option -g mouse off
# Don't wrap search in scroll buffer.
set-option -g wrap-search off
# message display time(ms)
set-option -g display-time 1500
# History
set-option -g history-limit 102400
# Increase repeat timeout
set-option -g repeat-time 400
# fastest command sequences
set-option -s escape-time 0
# slightly longer pane indicators display time
set-option -g display-panes-time 500
# disable various messages
# set-option -s quiet on
# open activity notify
set-option -g monitor-activity on
set-option -g visual-activity on
# Don't disturb.
set-option -g visual-bell off
# 24 hour clock
set-option -g clock-mode-style 24
set-option -g clock-mode-colour colour223
# neovim need autoread
set-option -g focus-events on
#}}}
# ======================================================================================================================
# UI
# ======================================================================================================================
#{{{
# set terminal title
set-option -g set-titles on
set-option -g set-titles-string "#h ❐ #S ● #I #W"
# 256-color terminal
set-option -g default-terminal "screen-256color"
# Add truecolor support (tmux info | grep Tc)
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Always show the status bar.
set-option -g status on
# Position of the status bar.
set-option -g status-position "bottom"
# set status panel item centre
set-option -g status-justify "centre"
set-option -g status-interval 3
# left status
#set-option -g status-left-attr bright
set-option -g status-left-length 120
set-option -g status-left "#[default]» #[fg=colour187]s:#S #[default]• #[fg=colour187]w#I.p#P • #(hostname) "
# right status
#set-option -g status-right-attr bright
set-option -g status-right-length 120
set-option -g status-right "#[default]• #[fg=#7fb8d8]#(date '+%y-%m-%d (%a) %H:%M') #[default]• #[fg=#7fb8d8]#(~/bin/timestamp) #[default]• #[fg=#7fb8d8]#(~/bin/loadavg)"
# modes
#set-option -g mode-bg colour235
#set-option -g mode-fg colour223
#set-option -g mode-attr bold
# set status background color
#set-option -g status-attr dim
set-option -g status-bg colour235
set-option -g status-fg colour248
# set pane and active color
#set-option -g pane-border-bg colour234
#set-option -g pane-border-fg colour234
#set-option -g pane-active-border-fg colour232
#set-option -g pane-active-border-bg colour233
# set status-bar window list color
#set-option -g window-status-bg default
#set-option -g window-status-fg white
#set-option -g window-status-attr dim
set-option -g window-status-format "#I:#W#F"
# set active window color
#set-option -g window-status-current-bg colour237
#set-option -g window-status-current-fg colour223
#set-option -g window-status-current-attr bold
set-option -g window-status-current-format "[#I:#W#F]"
# set command active color
#set-option -g message-bg default
#set-option -g message-fg white
#set-option -g message-attr bright
set-option -g message-style "bg=default,fg=red,bold"
set-option -g message-command-style "bg=default,fg=white,bold"
#}}}
# ======================================================================================================================
# Keymap
# ======================================================================================================================
#{{{
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
# Use Alt-arrow keys Without prefix key to switch panes
#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
#bind -n M-1 select-pane -t 1
#bind -n M-2 select-pane -t 2
#bind -n M-3 select-pane -t 3
bind -n M-h previous-window
bind -n M-l next-window
# clear both screen and history
bind -n C-l send-keys C-l \; run "tmux clear-history"
# reload config (prefix r), bind-key -r: use prefix, -n
unbind r
bind r source-file ~/.tmux.conf \; display "~/.tmux.conf Configuration reloaded!"
# Fix tmux exited on osx, brew install reattach-to-user-namespace
# MACOS-CONFIG Enable open(1) in OSX. Not needed for tmux>=2.6.
if-shell 'test "$(uname -s)" = Darwin' 'set-option -g default-command "exec reattach-to-user-namespace -l $SHELL"'
#unbind %
#bind | split-window -h
#unbind '"'
#bind - split-window -v
# set vim copy-mode
set-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection # start selecting text with "v"
bind-key -T copy-mode-vi 'y' send -X copy-selection # copy text with "y"
#}}}
# ======================================================================================================================
# Plugin
# ======================================================================================================================
#{{{
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Other Plugin
# set -g @plugin 'tmux-plugins/tmux-cpu'
# set -g @plugin 'tmux-plugins/tmux-battery'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
#}}}