tmux

tmux

新的公司,开发需要远程到另外一台开发机器上,所以开始使用 tmux,虽然还是喜欢 ubuntu 的 terminal 多一些点。

install

1
2
3
4
5
$ git clone https://github.com/tmux/tmux.git /tmp/tmux
$ cd /tmp/tmux
$ git checkout 2.8
$ sh autogen.sh
$ ./configure && make

conf

1
2
3
4
$ cd
$ git clone https://github.com/gpakosz/.tmux.git
$ ln -s -f .tmux/.tmux.conf
$ cp .tmux/.tmux.conf.local .

Bindings

  • <prefix> 等价于 ctrl + b 或者 ctrl + a

  • 切屏

    • <prefix> - 水平切分 –> tmux split
    • <prefix> _ 垂直切分 –> tmux split -h
  • 切换

    • <prefix> hjkl 切换分部
    • <prefix> HJKL 分部大小整理
    • <prefix> + 将当前屏幕切分到另外一个窗口
  • 窗口

    • tmux new-window
    • <prefix> ctrl h 切换前一个窗口
    • <prefix> ctrl l 切换后一个窗口
    • <prefix> number 切换指定窗口
    • <prefix> w 可以选择窗口哦
    • tmux rename-window $newName

Usage

1
2
3
4
$tmux new -s work
$do something
$<prefix> d
$tmux a -s work