-- base settings --#
Add truecolor support
set-option -ga terminal-overrides ",xterm-256color:Tc"
Default terminal is 256 colors
set -g default-terminal "screen-256color"
set -g display-time 3000
set -g escape-time 0
set -g history-limit 65535
set -g base-index 1
set -g pane-base-index 1
-- bindkeys --#
prefix key (Alt + z)
set -g prefix ^f
unbind ^b
bind f send-prefix
set-option -g prefix2 # 设置一个不常用的
键作为指令前缀,按键更快些
split window
unbind '"'
bind f send-prefix
set-option -g prefix2 # 设置一个不常用的
键作为指令前缀,按键更快些
split window
unbind '"'
vertical split (prefix -)
bind - splitw -v -c '#{pane_current_path}'
unbind %
bind = splitw -h -c '#{pane_current_path}' # horizontal split (prefix |)
select pane
bind k selectp -U # above (prefix k)
bind j selectp -D # below (prefix j)
bind h selectp -L # left (prefix h)
bind l selectp -R # right (prefix l)
resize pane
bind -r ^k resizep -U 10 # upward (prefix Ctrl+k)
bind -r ^j resizep -D 10 # downward (prefix Ctrl+j)
bind -r ^h resizep -L 10 # to the left (prefix Ctrl+h)
bind -r ^l resizep -R 10 # to the right (prefix Ctrl+l)
reload config (prefix r)
bind r source ~/.tmux.conf ; display "Configuration reloaded!"
set-option -g mouse on
设置窗口面板起始序号
set -g base-index 1 # 设置窗口的起始下标为1
set -g pane-base-index 1 # 设置面板的起始下标为1
set -s focus-events on
set-window-option -g automatic-rename on
set-window-option -g monitor-activity on
statusbar
set -wg window-status-format " #I #W " # 状态栏窗口名称格式
set -wg window-status-current-format " #I:#W#F " # 状态栏当前窗口名称格式(#I:序号,#w:窗口名称,#F:间隔符)
set -wg window-status-separator "|" # 状态栏窗口名称之间的间隔
set -g message-style "bg=#202529, fg=#91A8BA" # 指定消息通知的前景、后景色
自定义状态栏
set -g status-interval 1 # 状态栏刷新时间
set -g status-justify left # 状态栏列表左对齐
setw -g monitor-activity on # 非当前窗口有内容更新时在状态栏通知