文章目录
00. env
ubuntu 2004
tmux 3.0a
10. 安装tmux
sudo apt install tmux
# 查看版本
tmux -V
20. 安装插件 - resurect & continuum
1. 参考地址
https://github.com/tmux-plugins/tmux-resurrect/blob/master/README.md
https://github.com/tmux-plugins/tmux-continuum/blob/master/README.md
Please make sure you have tmux-resurrect installed.
2. 安装 (Manual Installation)
mkdir ~/tmp/
cd ~/tmp/
git clone http://github.com/tmux-plugins/tmux-continuum
git clone http://github.com/tmux-plugins/tmux-resurrect
mkdir ~/.tmux/
mv tmux-continuum/ ~/.tmux/
mv tmux-resurrect/ ~/.tmux/
3. 配置
- 新建配置文件~/.tmux.conf
touch ~/.tmux.conf
- 如下配置供参考:
set -g default-terminal "screen-256color"
set -g history-limit 10000
set -g status-interval 1
bind '"' splitw -v -c '#{pane_current_path}'
bind '%' splitw -h -c '#{pane_current_path}'
bind 'c' new-window -c '#{pane_current_path}'
run-shell ~/.tmux/tmux-resurrect/resurrect.tmux
run-shell ~/.tmux/tmux-resurrect/continuum.tmux
- 重新使能文件
shell 中,执行命令:
tmux source ~/.tmux.conf
- 使用示例
# 创建多个session
# ctrl+b c // 创建session
# 保存当前状态
ctrl+b ctrl+s
# 恢复之前状态
# tmux // 如果没进入tmux,先进入
ctrl+b ctrl+r
80. 快捷键说明
默认使用前缀键为Ctrl + b
1. 从tmux退出到shell
前缀键 + d
2. 进入指定tmux窗口、状态
tmux ls // 查看
tmux a -t xxx // 进入xxx这个窗口