代码: 全选
# https://linuxtoy.org/archives/from-screen-to-tmux.html
set -g prefix ^a
bind r source-file ~/.tmux.conf\; display "Reloaded!"
unbind ^b
bind a send-prefix
# 支持鼠标滚轮
# 水平或垂直分割窗口
unbind '"'
bind - splitw -v # 分割成上下两个窗口
unbind %
bind | splitw -h # 分割成左右两个窗口,注意,这个键是上位键,字符“|”要按着shift键输入
# 选择分割的窗格 注意,命令区分大小写
bind k selectp -U # 选择上窗格
bind j selectp -D # 选择下窗格
bind h selectp -L # 选择左窗格
bind l selectp -R # 选择右窗格
# 重新调整窗格的大小
#bind ^k resizep -U 5 # 跟选择窗格的设置相同,只是多加 Ctrl(Ctrl-k)
#bind ^j resizep -D 5 # 同上
#bind ^h resizep -L 5 # ...
#bind ^l resizep -R 5 # ...
# 重新调整窗格的大小(连续)
bind -r K resize-pane -U 3 #
bind -r J resize-pane -D 3 #
bind -r H resize-pane -L 3 #
bind -r L resize-pane -R 3 #
# 交换两个窗格
bind ^u swapp -U # 与上窗格交换 Ctrl-u
bind ^d swapp -D # 与下窗格交换 Ctrl-d
# 支持鼠标操作
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
set-window-option -g mode-mouse on