Tmux

Posted on Apr 9, 2024

自己的tmux.conf

# -----------------------------------------------------------------------------
# Tmux 基本配置 - 要求 Tmux >= 2.3
# 如果不想使用插件,只需要将此节的内容写入 ~/.tmux.conf 即可
# -----------------------------------------------------------------------------

# C-b 和 VIM 冲突,修改 Prefix 组合键为 Control-Z,按键距离近

unbind C-b
set -g prefix C-x

bind r source-file ~/.tmux.conf \; display "Reloaded!"

set -g base-index         1     # 窗口编号从 1 开始计数
set -g display-panes-time 10000 # PREFIX-Q 显示编号的驻留时长,单位 ms
set -g pane-base-index    1     # 窗格编号从 1 开始计数
set -g renumber-windows   on    # 关掉某个窗口后,编号重排

setw -g allow-rename      off   # 禁止活动进程修改窗口名
setw -g automatic-rename  off   # 禁止自动命名新窗口
setw -g mode-keys         vi    # 进入复制模式的时候使用 vi 键位(默认是 EMACS)

# 开启鼠标模式
# set -g mode-mouse on
# # 允许鼠标选择窗格
# set -g mouse-select-pane on

bind l select-pane -D
bind o select-pane -U
bind j select-pane -R
bind k select-pane -L

bind | split-window -h
bind - split-window -v


set -g status-fg white
set -g status-bg black