-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
47 lines (35 loc) · 1.79 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
### tmux config ###
set -g default-terminal "xterm-256color"
set-option -g mouse on
# 设置复制到系统剪切板
unbind -n -Tcopy-mode-vi MouseDragEnd1Pane
bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel\; run "tmux save-buffer - | pbcopy -i -sel clipboard > /dev/null"
# Linux 用 xclip
# bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel\; run "tmux save-buffer - | xclip -i -sel clipboard > /dev/null"
setw -g mode-keys vi # 复制模式使用 vi 键位
set -g status-interval 1 # 状态栏刷新时间
set -g status-justify left # 状态栏列表左对齐
setw -g monitor-activity off # 非当前窗口有内容更新时在状态栏通知
set -g renumber-windows on # 关掉某个窗口后,编号重排
set-option -g allow-rename off # 禁止自动重命名窗口
# 状态栏位置
set-option -g status-position bottom
# 状态栏样式
set -g status on
set -g status-fg black
set -g status-bg blue
set -g status-left-length 20
set -g status-left "#[fg=black,bg=green] #S "
set -g status-right "#[fg=black,bg=green] %H:%M:%S #(whoami)@local "
# 状态栏窗口样式
set -wg window-status-current-style fg=white,bg=red,bold
set -wg window-status-format " #I #W " # 状态栏窗口名称格式
set -wg window-status-current-format " #I:#W#F " # 状态栏当前窗口名称格式(#I:序号,#w:窗口名称,#F:间隔符)
set -wg window-status-separator "" # 状态栏窗口名称之间的间隔
# 分屏快捷键
bind-key '\' split-window -h # 水平分屏
bind-key '-' split-window -v # 垂直分屏
# 切换panes同步
bind-key S setw synchronize-panes
# 绑定刷新配置快捷键
bind-key r source-file ~/.tmux.conf \; display-message "Config reloading..."