Skip to content

Instantly share code, notes, and snippets.

@patricksuo
Created April 19, 2016 03:03
Show Gist options
  • Save patricksuo/3bce4fc8ff72598331ec13fc033183bc to your computer and use it in GitHub Desktop.
Save patricksuo/3bce4fc8ff72598331ec13fc033183bc to your computer and use it in GitHub Desktop.
tmux conf
#此类配置可以在命令行模式中输入show-options -g查询
set-option -g base-index 1 #窗口的初始序号;默认为0,这里设置为1
set-option -g display-time 5000 #提示信息的持续时间;设置足够的时间以避免看不清提示,单位为毫秒
set-option -g repeat-time 1000 #控制台激活后的持续时间;设置合适的时间以避免每次操作都要先激活控制台,单位为毫秒
set-option -g status-keys vi #操作状态栏时的默认键盘布局;可以设置为vi或emacs
set-option -g status-right "#(date +%H:%M' ')" #状态栏右方的内容;这里的设置将得到类似23:59的显示
set-option -g status-right-length 10 #状态栏右方的内容长度;建议把更多的空间留给状态栏左方(用于列出当前窗口)
set-option -g status-utf8 on #开启状态栏的UTF-8支持
set -g default-terminal "xterm-256color" # VIM 配色
#此类设置可以在命令行模式中输入show-window-options -g查询
set-window-option -g mode-keys vi #复制模式中的默认键盘布局;可以设置为vi或emacs
set-window-option -g utf8 on #开启窗口的UTF-8支持
#将激活控制台的快捷键由Ctrl+b修改为Ctrl+a
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
#添加自定义快捷键
bind-key z kill-session #按z结束当前会话;相当于进入命令行模式后输入kill-session
bind-key h select-layout even-horizontal #按h将当前面板布局切换为even-horizontal;相当于进入命令行模式后输入select-layout even-horizontal
bind-key v select-layout even-vertical #按v将当前面板布局切换为even-vertical;相当于进入命令行模式后输入select-layout even-vertical
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment