bingoogolapple / bingoogolapple.github.io

个人主页。同时也通过 Issues 记录学习笔记
http://www.bingoogolapple.cn
86 stars 19 forks source link

tmux #148

Open bingoogolapple opened 7 years ago

bingoogolapple commented 7 years ago

修改默认

  1. vim ~/.tmux.conf
    
    unbind C-b
    set -g prefix C-a
    setw -g mode-keys vi

bind s split-window -h bind v split-window -v

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

bind < resize-pane -L 10 bind > resize-pane -R 10 bind - resize-pane -D 10 bind + resize-pane -U 10

bind : command-prompt

bind r source-file ~/.tmux.conf \; display-message "Config reloaded"


2. 重启 tmux 或者 先 ctrl + b,然后输入冒号进入命令行模式,然后输入 source-file ~/.tmux.conf

这次配置完后,下次再修改配置的话直接 ctrl + a,然后 r 就可以了
bingoogolapple commented 7 years ago

常用按键

% 或者 s 水平方向分隔 Window " 或者 v 垂直方向分隔 Window

c 创建新 Window , 重命名 Window & 关闭窗口 n 选择下一个 Window p 选择前一个 Window

x 关闭面板

bingoogolapple commented 7 years ago

新建 Session 并指定名称为 test

tmux new -s test

前缀,然后 d 退出 tumx,并保存当前 Session,这时 tmux 仍在后台运行,可以通过下面的命令进入到指定 Session,如果只有一个 Session,可以不指定 -t 参数和 Session 名字

tmux a -t test

关闭指定 Session

tmux kill-session -t test

关闭 tmux

tmux kill-server