tmuxinator安装和使用
tmuxinator 的安装方式、配置文件位置与最小项目布局示例。
#type / howto
#status / evergreen
#tech / dev
#resource / tmuxinator
#resource / tmux
[!info] related notes
tmuxinator安装和使用
配置文件位置
默认目录:
~/.config/tmuxinator/
安装
# Ubuntu / WSL
sudo apt install tmuxinator
# Ruby 环境
gem install tmuxinator
创建项目布局
tmuxinator new my_project
这会打开一个 YAML 文件。最小示例:
name: my_project
root: ~/projects/my_project
# 启动前的公共命令(可选)
# pre_window: source venv/bin/activate
windows:
- editor:
layout: main-vertical
panes:
- nvim
- npm run serve
- git status
- database:
layout: tiled
panes:
- mysql -u root
启动项目
tmuxinator start my_project
也可以简写为:
mux my_project
适用场景
- 每个项目都有比较固定的工作区布局
- 你希望布局配置文件可以长期维护
- 你想把“会话结构”从 shell 脚本里抽出来
如果你的目标是恢复“上次的现场”,那更适合看 tmux 中保持布局 里的 tmux-resurrect 路线。