-
Notifications
You must be signed in to change notification settings - Fork 5
/
tmux.conf.ubuntu16
59 lines (51 loc) · 3.21 KB
/
tmux.conf.ubuntu16
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
# 此类配置可以在命令行模式中输入show-options -g查询
set-option -g base-index 1 # 窗口的初始序号;默认为0,这里设置为1
set-option -g display-time 5000 # 提示信息的持续时间;设置足够的时间以避免看不清提示,单位为毫秒
set-option -g repeat-time 1000 # 控制台激活后的持续时间;设置合适的时间以避免每次操作都要先激活控制台,单位为毫秒
set-option -g status-keys vi # 操作状态栏时的默认键盘布局;可以设置为vi或emacs
set-option -g status-utf8 on # 开启状态栏的UTF-8支持
set-option -g status-bg blue
set-option -g status-fg '#bbbbbb'
set-option -g status-left-fg green
set-option -g status-left-bg blue
set-option -g status-right-fg green
set-option -g status-right-bg blue
set-option -g status-left-length 10 # 状态栏左方的内容长度;
set-option -g status-right-length 15 # 状态栏右方的内容长度;建议把更多的空间留给状态栏左方(用于列出当前窗口)
set-option -g status-left '[#(whoami)]' # 状态栏左方的内容
set-option -g status-right '[#(date +" %m-%d %H:%M ")]' # 状态栏右方的内容;这里的设置将得到类似23:59的显示
set-option -g status-justify "centre" # 窗口列表居中显示
set-option -g default-terminal "screen-256color" # 支持256色显示
# 分割窗口边界的颜色
set-option -g pane-active-border-fg '#55ff55'
set-option -g pane-border-fg '#555555'
# 此类设置可以在命令行模式中输入show-window-options -g查询
set-window-option -g mode-keys vi # 复制模式中的默认键盘布局;可以设置为vi或emacs
set-window-option -g utf8 on # 开启窗口的UTF-8支持
set-window-option -g mode-mouse on # 窗口切换后让人可以用鼠标上下滑动显示历史输出
# 将激活控制台的快捷键由Ctrl+b修改为Ctrl+a
set-option -g prefix C-b
unbind-key C-a
bind-key C-b send-prefix
# 窗口切分快捷键
bind \ split-window -h # 使用 \ 将窗口竖切
bind - split-window -v # 使用 - 将窗口横切
bind K confirm-before -p "kill-window #W? (y/n)" kill-window # 使用大写 K 来关闭窗口
bind '"' choose-window # 双引号选择窗口
# Pane之间切换的快捷键
bind h select-pane -L # 定位到左边窗口的快捷键
bind j select-pane -D # 定位到上边窗口的快捷键
bind k select-pane -U # 定位到下方窗口的快捷键
bind l select-pane -R # 定位到右边窗口的快捷键
# 设置window属性
setw -g window-status-current-bg red
setw -g window-status-current-fg white
setw -g window-status-current-attr bright
setw -g window-status-attr bright
set-option -g window-status-format '#I #W'
set-option -g window-status-current-format ' #I #W '
setw -g window-status-current-bg blue
setw -g window-status-current-fg green
# 不使用prefix键,使用Ctrl和左右方向键方便切换窗口
bind-key -n "C-Left" select-window -t :-
bind-key -n "C-Right" select-window -t :+