-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
164 lines (134 loc) · 4.44 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
##################
# Common setting #
##################
# Allows mouse
#setw -g mode-mouse on
#set -g mouse-resize-pane on
#set -g mouse-select-pane on
#set -g mouse-select-window on
# In 2.1, only one lines to turn on mouse
set -g mouse on
# https://github.com/tmux/tmux/issues/145#issuecomment-151098708
# Start copy mode when scrolling up and exit when scrolling down to bottom.
# The "#{mouse_any_flag}" check just sends scrolls to any program running that
# has mouse support (like vim).
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" \
"if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
# Toggle mouse
bind m set -g mouse on \; display "Mouse: ON"
bind M set -g mouse off \; display "Mouse: OFF"
set -g xterm-keys on
# vi
setw -g mode-keys vi
set -g status-keys vi
# automatically renumber tmux windows
set -g renumber-windows on
# Start tmux with biggest size if possible
setw -g aggressive-resize on
# scroll up limit
set -g history-limit 10000
################
# tmux Plugins #
################
# plugin manager
set -g @plugin 'tmux-plugins/tpm'
# for tmux session save and restore
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-strategy-vim 'session'
# copy to clipbroad
# set -g @plugin 'tmux-iplugins/tmux-yank'
# enhance tmux search
# set -g @plugin 'tmux-plugins/tmux-copycat'
# Initialize TMUX plugin manager
run '~/.tmux/plugins/tpm/tpm'
################
# Key Bindings #
################
# reload config file
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"
# synchronize all panes in a window
bind y setw synchronize-panes
################
# Status Bar #
################
# Rewrite tmux-themepack
### Need in MAC:
# brew tap caskroom/fonts
# brew cask install font-hack-nerd-font
### Need for Linux system with apt package:
# sudo apt-get install fonts-powerline
# Status update interval
set -g status-interval 1
# Basic status bar colors
set -g status-fg colour240
set -g status-bg colour233
#S : session name
#D : pane ID
#P : pane index
#T : pane title
#I : window index
#W : window name
#F : window flag
#H : localhost hostname with domain name
#h : localhost hostname without domain name
# colour codes:
# colour233: black like
# colour214 orange
# colour184: yellow
# colour112: green
# colour39: blue
# Left side of status bar
set -g status-left-bg colour233
set -g status-left-fg colour243
set -g status-left-length 40
set -g status-left "#[fg=colour233,bg=colour39,bold] #(whoami) #[fg=colour39,bg=colour112,nobold]#[fg=colour233,bg=colour112] #(uptime | awk -F ',' '{print $1}' | awk '{print $3\" \"$4}') #[fg=colour112,bg=colour184]#[fg=colour233,bg=colour184] #S:#I:#P #[fg=colour184,bg=colour233]"
# Right side of status bar
set -g status-right-bg colour233
set -g status-right-fg colour243
set -g status-right-length 150
set -g status-right "#[fg=colour184,bg=colour233]#[fg=colour233,bg=colour184] %d-%b-%y #[fg=colour112,bg=colour184]#[fg=colour233,bg=colour112] #(tmux-mem-cpu-load) #[fg=colour39,bg=colour112]#[fg=colour233,bg=colour39,bold] #H "
# Window status
set -g window-status-format " #I:#W#F "
set -g window-status-current-format "#[fg=colour252,bg=black,bold] #I:#W#F "
# Idle window status
set -g window-status-fg colour235
set -g window-status-bg colour252
# Current window status
set -g window-status-current-bg colour39
set -g window-status-current-fg colour235
# Window with activity status
set -g window-status-activity-bg colour245 # fg and bg are flipped here due to
set -g window-status-activity-fg colour233 # a bug in tmux
# Window separator
set -g window-status-separator ""
# Window status alignment
set -g status-justify centre
# Pane border
set -g pane-border-bg default
set -g pane-border-fg colour238
# Active pane border
set -g pane-active-border-bg default
set -g pane-active-border-fg colour39
# Pane number indicator
set -g display-panes-colour colour245 #grey
set -g display-panes-active-colour colour39 #blue
# Clock mode
set -g clock-mode-colour colour39
set -g clock-mode-style 24
# Message
set -g message-bg colour39
set -g message-fg black
# Command message
set -g message-command-bg colour233
set -g message-command-fg black
# Mode
set -g mode-bg colour39
set -g mode-fg colour232
################
# Binding keys #
################
# Ref: https://bit.ly/2Ld39fG
# User Ctrl+V to be the prefix key in 2nd layer of tmux
bind-key -n C-V send-prefix
# User Ctrl+G to be the prefix key in 3rd layer of tmux
bind-key -n C-G send-prefix \; send-prefix