命令行利器tmux

tmux是一个优秀的终端复用软件,类似GNU Screen,但是对两个软件评价已经是一边倒了,大多数人认为tmux功能更加强大,使用更加方便。详细的对比可以看这里, 这里

tmux 不仅可以提高终端工作效率,是服务器管理工作必不可少的工具,更拉风的是可以做远程的Pair Programming。下面视频介绍了一些常用操作。

下面是我的一些.tmux.conf设置

.tmux.conflink
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
unbind C-b
set -g prefix C-a
setw -g mode-keys vi

# split window like vim
# vim's defination of a horizontal/vertical split is revised from tumx's
bind s split-window -h
bind v split-window -v
# move arount panes wiht hjkl, as one would in vim after C-w
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by,
# only one at a time can be slow
bind < resize-pane -L 10
bind > resize-pane -R 10
bind - resize-pane -D 10
bind + resize-pane -U 10

# bind : to command-prompt like vim
# this is the default in tmux already
bind : command-prompt