# 修改默认Prefix set-option -g prefix C-a unbind-key C-a bind-key C-a send-prefix # Easy config reload bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "tmux.conf reloaded" # Plugins setenv -g TMUX_PLUGIN_MANAGER_PATH '~/.tmux/plugins' set -g @plugin 'seebi/tmux-colors-solarized' set -g @plugin 'tmux-plugins/tmux-pain-control' set -g @plugin 'tmux-plugins/tmux-prefix-highlight' set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'tmux-plugins/tpm' set -g mouse on # 打开鼠标支持 set-option -g display-time 5000 # 提示信息的持续时间 设置足够的时间以避免看不清提示,单位为毫秒 set-option -g repeat-time 1000 # 控制台激活后的持续时间 避免每次操作都要先激活控制台,单位为毫秒 set-option -g status-keys vi # 操作状态栏时的默认键盘布局;可以设置为vi或emacs # 此类设置可以在命令行模式中输入show-window-options -g查询 set-window-option -g mode-keys vi # 复制模式中的默认键盘布局;可以设置为vi或emacs ### set-option -g status-bg blue set-option -g status-fg '#bbbbbb' set-option -g status-left-length 10 # 状态栏左方的内容长度; set-option -g status-right-length 15 # 状态栏右方的内容长度;建议把更多的空间留给状态栏左方(用于列出当前窗口) set-option -g status-left '[#(whoami)]' # 状态栏左方的内容 set-option -g status-right '[#(date +" %m-%d %H:%M ")]' # 状态栏右方的内容;这里的设置将得到类似23:59的显示 set-option -g status-justify "centre" # 窗口列表居中显示 set-option -g default-terminal "screen-256color" # 支持256色显示 # Pane之间切换的快捷键 bind h select-pane -L # 定位到左边窗口的快捷键 bind j select-pane -D # 定位到上边窗口的快捷键 bind k select-pane -U # 定位到下方窗口的快捷键 bind l select-pane -R # 定位到右边窗口的快捷键 # 垂直分割窗格 (Command + D) bind-key -n C-d split-window -h # 水平分割窗格 (Command + Return) bind-key -n C-Return split-window -v # 新建选项卡 (Command + T) bind-key -n C-t new-window # 关闭窗格 (Command + W) bind-key -n C-w kill-pane # 关闭选项卡 (Command + Shift + W) bind-key -n C-S-w kill-window # detach 当前窗口 bind-key -n C-q detach-client # 访问左边的窗格 (Command + H 或 Command + Left) bind-key -n C-h select-pane -L bind-key -n C-Left select-pane -L # 访问上面的窗格 (Command + J 或 Command + Up) bind-key -n C-j select-pane -U bind-key -n C-Up select-pane -U # 访问下面的窗格 (Command + K 或 Command + Down) bind-key -n C-k select-pane -D bind-key -n C-Down select-pane -D # 访问右边的窗格 (Command + L 或 Command + Right) bind-key -n C-l select-pane -R bind-key -n C-Right select-pane -R # 切换选项卡 (Command + 1 到 Command + 9) bind-key -n M-1 select-window -t :=1 bind-key -n M-2 select-window -t :=2 bind-key -n M-3 select-window -t :=3 bind-key -n M-4 select-window -t :=4 bind-key -n M-5 select-window -t :=5 bind-key -n M-6 select-window -t :=6 bind-key -n M-7 select-window -t :=7 bind-key -n M-8 select-window -t :=8 bind-key -n M-9 select-window -t :=9 # 切换到上一个选项卡 (Command + [) bind-key -n C-[ previous-window # 切换到下一个选项卡 (Command + ]) bind-key -n C-] next-window ### Run TPM Manger run '~/.tmux/plugins/tpm/tpm'