-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtmux_conf
161 lines (126 loc) · 4.02 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
# Add truecolor support
set-option -ga terminal-overrides ",*256col*:Tc"
# set -ga terminal-overrides ',*:Tc'
# # Default terminal is 256 colors
# set -g default-terminal "screen-256color"
# set prefix to C-s
set -g prefix C-s
# unbind default prefix
unbind-key C-b
# bind C-s as prefix
bind C-s send-prefix
# reload config
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# set only on OS X where it's required
#set -g default-command "reattach-to-user-namespace -l $SHELL"
# emacs key bindings in tmux command prompt (prefix + :) are better than
# # vi keys, even for vim users
set -g status-keys emacs
# focus events enabled for terminals that support them
set -g focus-events on
# super useful when using "grouped sessions" and multi-monitor setup
# conflict with iIerm2
# setw -g aggressive-resize on
###### layout settings ########
# window start index
set -g base-index 1
# pane start index
setw -g pane-base-index 1
# renumber windows when a window is closed
set -g renumber-windows on
# mouse support
# set-option -g default-command "reattach-to-user-namespace -l zsh"
set -g mouse on
bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
# fix vim mode switching delay
set -s escape-time 0
# increase scrollback buffer size
set -g history-limit 20000
# 修改默认的窗口分割快捷键,使用更直观的符号
# split
unbind %
bind | split-window -h
unbind '"'
bind - split-window -v
bind _ split-window -v
# select pane
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
### window jumping
## vi style
bind -r M-h select-window -t :-
bind -r M-l select-window -t :+
### pane resizing
# vi style
bind -r H resize-pane -L
bind -r J resize-pane -D
bind -r K resize-pane -U
bind -r L resize-pane -R
# main key area
bind C-c new-window
bind C-k kill-window
bind C-p previous-window
bind C-n next-window
bind Space last-window
bind a last-window
##################################################
# visual style
##################################################
### status bar
# status bar items
# left side
set -g status-left-length 42
set -g status-left "#[bg=green,fg=colour232,bold] #h #[bg=blue,fg=colour232,bold] #S "
# right side
set -g status-right-length 25
set -g status-right "#[bg=green,fg=colour232,bold] %H:%M %m/%d/%Y %a "
# window list
# strip window separator
setw -g window-status-separator ""
# for non-current window
setw -g window-status-format "#[bg=colour236,fg=colour248,nobold] #I #W "
# for current window
setw -g window-status-current-format "#[bg=magenta,fg=colour235,bold] #I #W "
#setw -g window-status-alert-fg red
# last window
#setw -g window-status-last-fg colour105
# refresh 'status-left' and 'status-right' more often
set -g status-interval 20
# centering the window list
set -g status-justify left
### indentifying activity in other windows
# enable activity alerts
setw -g monitor-activity on
set -g visual-activity off
# set the alert visual style
setw -g window-status-activity-attr blink
# default statusbar colors
set-option -g status-bg colour235 # black
set-option -g status-fg colour6 # orange
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour15
set-window-option -g window-status-bg default
# active window title colors
set-window-option -g window-status-current-fg red
set-window-option -g window-status-current-bg default
# pane border
set-option -g pane-border-fg colour8
set-option -g pane-active-border-fg green
# message text
set-option -g message-bg colour235 # black
set-option -g message-fg red
# modes
setw -g mode-attr bold
setw -g mode-fg colour13
setw -g mode-bg colour11
# pane number display
set-option -g display-panes-active-colour green
set-option -g display-panes-colour blue
# clock
setw -g clock-mode-colour blue
# bell
# set-window-option -g window-status-bell-style fg=colour235,bg=colour160 #base02, red