tmux2系を使っている。tmuxinatorを入れるのにRubyからインストールって大変だなぁと思っていた。 今更tpmというパッケージマネージャの存在を知り、 tmux-resurrect というセッションをsave/restoreするtmuxプラグインを知った。
導入方法
- TPM (tmux plugin manager) をgit cloneする
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
.tmux.conf
の編集 (tmux-resurrectの設定も含む)
# List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-resurrect-auto' set -g @plugin 'tmux-plugins/tmux-continuum' set -g @continuum-restore 'on' # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm'
- 設定の読み込み
tmux source ~/.tmux.conf
- プラグインのインストール
上記設定に記載したものを prefix + I (大文字のi)でインストールできる。
使い方
tmux-resurrect-auto プラグインが自動で保存してくれる。tmux-continuumプラグインが自動でrestoreしてくれる。 明示的に実行するなら
- セッションの保存
prefix + C-s
- セッションの読み込み
prefix + C-r