-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathtmux.conf
More file actions
86 lines (73 loc) · 3.75 KB
/
Copy pathtmux.conf
File metadata and controls
86 lines (73 loc) · 3.75 KB
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
# 解除键绑定
unbind C-z
unbind n
bind r source-file ~/.tmux.conf \; display "Conf Reloaded!" # 将r键设置为加载配置文件,并显示"reloaded!"信息
bind C-b setw synchronize-panes # 开启/关闭 pane 同步模式
bind -n C-t new-window -c "#{pane_current_path}" # 新建window
bind -n C-PgUp previous-window # 上一个window
bind -n C-PgDn next-window # 下一个window
bind -n C-n next-window # 下一个window
set -g repeat-time 600 # 带-r标志的键重复时间
set -g base-index 1 # 窗口序号默认从1开始
set -g pane-base-index 1 # 面板序号从1开始
set -g default-terminal "screen-256color" # 设置256色
set -g history-limit 50000 # 滚动历史
# 设置鼠标及复制模式
bind m setw mouse # 鼠标开关
set -g mouse on
set -g set-clipboard on
set -g mode-keys vi
set -g mode-style "fg=white,bg=color27"
# 针对 vi 模式下的 copy-mode (推荐)
bind -T copy-mode-vi WheelUpPane send -N 1 -X scroll-up
bind -T copy-mode-vi WheelDownPane send -N 1 -X scroll-down
# 针对默认模式下的 copy-mode
bind -T copy-mode WheelUpPane send -N 1 -X scroll-up
bind -T copy-mode WheelDownPane send -N 1 -X scroll-down
# 鼠标选中及复制
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
# 鼠标拖动复制, 单击清除选择, 双击复制单词, 三击复制整行
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "pbcopy"
bind -T copy-mode-vi MouseDown1Pane send-keys -X clear-selection
bind -n DoubleClick1Pane copy-mode -M \; send-keys -X select-word \; run-shell -d 0.2 \; send-keys -X copy-pipe-no-clear "pbcopy"
bind -n TripleClick1Pane copy-mode -M \; send-keys -X select-line \; run-shell -d 0.2 \; send-keys -X copy-pipe-no-clear "pbcopy"
# pane 颜色
set -g pane-border-style fg="#373737"
set -g pane-active-border-style fg=blue
# message 颜色
set -g message-style fg=yellow,bg=black,bold
# 设置 status bar 中窗口列表颜色
setw -g window-status-current-style bold
setw -g window-status-current-format "😊#[fg=red][#[fg=yellow]#I #W#[fg=red]]" # 当前窗口
setw -g window-status-format " #[fg=cyan][#[fg=blue]#I #W#[fg=cyan]]" # 其他窗口
# 设置 status bar 格式
set -g status-style default
set -g status-left-length 12
set -g status-left "#{?pane_synchronized,#[fg=black bg=yellow]Session: #S,#[fg=blue]Session: #S}" # 面板同步开启后,左下角Session高亮
set -g status-right "#[fg=blue]%R#{?mouse,#[fg=yellow] 🖰 ,#[fg=blue] 🖰 }" # 鼠标模式开启后,右下角鼠标符高亮
set -g status-interval 60
set -g status-justify centre
# 分割窗口
bind C-j splitw -v -c "#{pane_current_path}" # 分割成上下两个窗口
bind C-l splitw -h -c "#{pane_current_path}" # 分割成左右两个窗口
bind -r Space next-layout # 选择下一个布局
# 选择 pane
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
# 小幅调整 pane 大小
bind -r K resize-pane -U 1
bind -r J resize-pane -D 1
bind -r H resize-pane -L 2
bind -r L resize-pane -R 2
# 大幅调整 pane 大小
bind -r Up resize-pane -U 5
bind -r Down resize-pane -D 5
bind -r Left resize-pane -L 10
bind -r Right resize-pane -R 10
# 开启window事件提示
setw -g monitor-activity on
set -g visual-activity off