-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
95 lines (79 loc) · 2.89 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
#设置emacs按键操作
# setw -g mode-keys emacs
setw -g mode-keys vi
set -g default-terminal "screen-256color"
#刷新tmux配置文件(增量刷新,原有配置除非被覆盖或者被显示unbind否则仍然生效,需要重启才能完全按照新配置)
#display用于显示信息,两个命令之间用\;断开
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# start window index from 1
set -g base-index 1
# start pane index from 1
set -g pane-base-index 1
#设置选择窗口(pane)
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# bind-key -n C-[ select-pane -L
# bind-key -n C-] select-pane -R
#改变pane大小
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# re-order windows
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
# switch from windows
bind -n S-Left select-window -t :-
bind -n S-Right select-window -t :+
#设置重复时间为1000毫秒,即prefix有效的时间(不用重复输入prefix)
set -g repeat-time 1000
#设置能够使用鼠标以及鼠标可用的动作
setw -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
#设置状态栏配色
set -g status-fg white
set -g status-bg black
#设置窗口列表配色
#cyan, red, white, default, magenta, red, black, blue, yellow...
#status-attr dim, bold, bright
setw -g window-status-fg white
setw -g window-status-bg default
setw -g window-status-attr bold
setw -g window-status-current-fg white
setw -g window-status-current-bg magenta
setw -g window-status-current-attr bright
#设置pane配色,同时设置活动pane边框配色
set -g pane-border-fg green
set -g pane-border-bg black
set -g pane-active-border-fg white
set -g pane-active-border-bg yellow
#设置提示消息配色
set -g message-fg white
set -g message-bg black
set -g message-attr bright
#设置copy-mode开启utf8支持
set -g status-utf8 on
#窗口列表居中
set -g status-justify centre
#监视窗口活动,有活动高亮该窗口项
setw -g monitor-activity on
set -g visual-activity on
# Copy-paste integration
set-option -g default-command "reattach-to-user-namespace -l fish"
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
#
# # Bind ']' to use pbpaste
bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# #将prefix C-c绑定到命令,将当前tmux剪切版里的数据复制到系统剪切版
# bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
# #从系统剪切版粘贴到当前位置
# bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"