一篇写的很好的博客,将tmux中的相关概念讲的很清楚
https://nightfarmer.top/post/tmux/
比如说以下的,概念图能很好的理清日常命令各种切换的操作困惑
自定义配置
# 设置前缀命令为ctrl+a
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
# 设置直接使用alt+方向键切换pane
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# 设置使用shift+左右键切换window
bind -n S-Left previous-window
bind -n S-Right next-window
# 开启鼠标模式 可以通过鼠标点击切换pane和window 可以拖拽调整pane尺寸
set -g mouse on
# 快速加载配置文件,使用前缀命令+r即可,不用关闭session
bind-key r source-file ~/.tmux.conf \; display-message "tmux.conf 文件重进加载"
# 关闭窗口名字被默认修改,这样通过前缀命令+,修改后在再次手动修改前都不会变更。
set-option -g allow-rename off
# #设置终端颜色为256色
set -g default-terminal "screen-256color"
# 重定义分隔窗格快捷键, %和"不好记也不好操作,换为horizontal和vertical的首字母,这样更容易理解和操作
unbind '"'
unbind %
bind-key h split-window -h
bind-key v split-window -v
# 设置复制模式的按键为vim风格
set -g mode-keys vi