-
Notifications
You must be signed in to change notification settings - Fork 4
/
.tmux.conf
65 lines (46 loc) · 1.74 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
# C-b即Ctrl+b键,unbind意味着解除绑定
unbind C-b
# 绑定Ctrl+a为新的指令前缀
set -g prefix C-a
# 从tmux v1.6版起,支持设置第二个指令前缀, 设置一个不常用的`键作为指令前缀,按键更快
set-option -g prefix2 `
# 关闭自动重命名
setw -g automatic-rename off
# 禁止活动进程修改窗口名
setw -g allow-rename off
# 使用vi风格
setw -g mode-keys vi
# 是否开启鼠标支持, 这里没有开启
# set-option -g mouse on
# --------------------from tmux_plugins/sensible-------------------------------
# Address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0
# Increase scrollback buffer size from 2000 to 50000 lines
set -g history-limit 50000
# Increase tmux messages display duration from 750ms to 4s
set -g display-time 4000
# Refresh 'status-left' and 'status-right' more often, from every 15s to 5s
set -g status-interval 5
# Upgrade $TERM
set -g default-terminal "screen-256color"
# 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
setw -g aggressive-resize on
# 修改分屏快捷键
unbind '"'
bind - splitw -v -c '#{pane_current_path}' # 垂直方向新增面板,默认进入当前目录
unbind %
bind | splitw -h -c '#{pane_current_path}' # 水平方向新增面板,默认进入当前目录
# 设置面板大小调整快捷键
bind j resize-pane -D 5
bind k resize-pane -U 5
bind h resize-pane -L 5
bind l resize-pane -R 5
# 刷新配置文件
bind R run-shell "tmux source-file ~/.tmux.conf"
# 上一个窗口
bind a last-window