常用配置

1
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
set -g mouse on
set -g base-index 1 #让窗口从1开始
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"


set -g @scroll-speed-num-lines-per-scroll 10 #鼠标滚轮滚动速度10


# List of plugins #安装的插件列表
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'

# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'

# Initialize TMUX plugin manager (keep this line at the very bottom of
# tmux.conf)
run '~/.tmux/plugins/tpm/tpm' #插件管理器tpm

动态更新tmux配置文件

方法1. 在shell终端加载

1
tmux source-file ~/.tmux.conf

方法2. 在tmux内加载。Ctrl+b :

1
:source-file ~/.tmux.conf

配置tmux滚动速度

先安装插件 tmux-scroll-copy-mode ,再把添加下面行到 ~/.tmux.conf

1
set -g @scroll-speed-num-lines-per-scroll 10

tmuxp

1
2
3
4
5
6
7
8
9
10
11
12
13
$ cat ~/op.yaml
session_name: op
windows:
- window_name: vim
layout: tiled
shell_command_before:
- cd ~/tmp/openwrt
- window_name: make
layout: tiled
shell_command_before:
- cd ~/tmp/openwrt

$ tmuxp load ~/op.yaml