tmux

先安装 libevent2.x

tmux安装过程报错可能是缺libevent,先安装libevent

1
2
3
4
5
6
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar zxvf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=$HOME
make
make install

安装 tmux

安装tmux,运行tmux如果缺库,则把libevent-* 连接到lib目录。

1
2
3
4
5
6
7
git clone https://github.com/tmux/tmux.git
cd tmux
sh autogen.sh
DIR="$HOME"
./configure CFLAGS="-I$DIR/include" LDFLAGS="-L$DIR/lib"
make

tmux 配置

1
2
cd ~/
em .tmux.conf
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
26
27
28
29
30
31
32
33
34
35
## .tmux.conf 内容:
set -g history-limit 10000
# Automatically set window title
#set-window-option -g automatic-renam
#set-window-option -g xterm-keys on
set-option -g set-titles on
# Shift arrow to switch windows S shift M alt C ctrl
unbind-key -n S-Left
unbind-key -n S-Right
#bind -n C-Left previous-window
#bind -n C-Right next-window
bind -n F2 new-window
bind -n F3 previous-window
bind -n F4 next-window
bind -n F7 copy-mode
# kill window (prefix Ctrl+q)
#bind ^q killw
# display
#set -g status-utf8 on
set -g status-keys vi
set -g status-interval 1
set -g status-attr bright
set -g status-fg white
set -g status-bg black
set -g status-left-length 20
set -g status-left '#[fg=green][#[fg=red]#S#[fg=green]]#[default]'
set -g status-justify centre
set -g status-right '#[fg=green][ %m/%d %H:%M:%S ]#[default]'
setw -g window-status-current-format '#[fg=yellow](#I.#P#F#W)#[default]'
setw -g window-status-format '#I#F#W'