set-option -g prefix `

# 重载配置文件
bind r source-file ~/.tmux.conf \; display-message "Config reloaded.."

# 窗口排序
bind R                                      \
    set -g renumber-windows on\;            \
    new-window\; kill-window\;              \
    set -g renumber-windows off\;           \
    display-message "Windows reordered..."

# 历史缓冲区
set -g history-limit 5000

# 开启鼠标支持
#set-option -g mouse on
# 2.1 版本之前需要以下四条配置
#setw -g mode-mouse on # 支持鼠标选取文本等
#setw -g mouse-resize-pane on # 支持鼠标拖动调整面板的大小(通过拖动面板间的分割线)
#setw -g mouse-select-pane on # 支持鼠标选中并切换面板
#setw -g mouse-select-window on # 支持鼠标选中并切换窗口(通过点击状态栏窗口名称)

# 分屏快捷键
#unbind '"'
#unbind '%'
bind - splitw -v -c '#{pane_current_path}' # 垂直方向新增面板,默认进入当前目录
bind | splitw -h -c '#{pane_current_path}'  # 

# 分屏移动快捷键
bind -r k select-pane -U # 绑定k为↑
bind -r j select-pane -D # 绑定j为↓
bind -r h select-pane -L # 绑定h为←
bind -r l select-pane -R # 绑定l为→

# 状态栏
set -g base-index 1 # 设置窗口的起始下标为1
set -g pane-base-index 1 # 设置面板的起始下标为1
#set -g status-utf8 on # 状态栏支持utf8
set -g status-interval 1 # 状态栏刷新时间
set -g status-justify left # 状态栏列表左对齐
setw -g monitor-activity on # 非当前窗口有内容更新时在状态栏通知
set -g status-left "#[bg=#FF661D] ❐ #S " # 状态栏左侧内容
set -g status-left-length 300 # 状态栏左边长度300
set -g status-right-length 500 # 状态栏左边长度500
set -wg window-status-format " #I #W " # 状态栏窗口名称格式
set -wg window-status-current-format " #I:#W#F " # 状态栏当前窗口名称格式(#I:序号,#w:窗口名称,#F:间隔符)
set -wg window-status-separator "" # 状态栏窗口名称之间的间隔

# 开启256 colors支持
set -g default-terminal "screen-256color"

# 复制粘贴  `+[ 进入复制模式 空格键开始选择 回车键选择完成 `+]粘贴
setw -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# 2.4版本以下生效
#bind -t vi-copy v begin-selection # 绑定v键为开始选择文本
#bind -t vi-copy y copy-selection # 绑定y键为复制选中文本

http://louiszhai.github.io/2017/09/30/tmux/