ユーザ用ツール

サイト用ツール


serverapps:tmux:plugin

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
serverapps:tmux:plugin [2022/12/03 17:49]
hayashi [install]
serverapps:tmux:plugin [2023/10/09 22:30] (現在)
hayashi [tcsh@FreeBSD]
行 9: 行 9:
 === Configure === === Configure ===
  
-~/.tmux.conf の末尾に以下を追記し、<prefix + I>キーでインストール。+~/.tmux.conf の末尾に以下を追記
 <file conf ~/.tmux.conf> <file conf ~/.tmux.conf>
 # List of plugins # List of plugins
 set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tpm'
 set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-sensible'
 +
 +# Other examples:
 +# set -g @plugin 'github_username/plugin_name'
 +# set -g @plugin 'github_username/plugin_name#branch'
 +# 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'
 </file> </file>
 または または
行 20: 行 29:
 set -g @tpm_plugins '              \ set -g @tpm_plugins '              \
   tmux-plugins/tpm                 \   tmux-plugins/tpm                 \
-  tmux-plugins/tmux-resurrect      \+  tmux-plugins/tmux-sensible       \
 ' '
 </file> </file>
 +
 +=== tmux設定の再読み込み ===
 +
 +  # type this in terminal if tmux is already running
 +  $ tmux source ~/.tmux.conf
  
 ===== Tmux Resurrect ===== ===== Tmux Resurrect =====
 tmux-plugins/tmux-resurrectはtmuxのセッションを保存・復元するためのtmux plugin.\\ tmux-plugins/tmux-resurrectはtmuxのセッションを保存・復元するためのtmux plugin.\\
 Tmux Resurrectプラグインを使用するとtmux環境を保存できるので、PCを再起動しても環境を簡単に復元できるようになる。\\ Tmux Resurrectプラグインを使用するとtmux環境を保存できるので、PCを再起動しても環境を簡単に復元できるようになる。\\
 +
 +  set -g @plugin 'tmux-plugins/tmux-resurrect'
 +
 +===== plugin 読み込み =====
 +
 +**prefix + I((大文字I(アイ) ))** で plugin 読み込みます
 +===== 起動 =====
 +
 +
 +
 +なお、**bash**に依存していますので、それ以外のshellを使用している場合には以下のような感じで起動
 +
 +  bash -c "tmux new -s Work"
 +
 +===== Key bindings =====
 +
 +  prefix + Ctrl-s - save
 +  prefix + Ctrl-r - restore
 +
 +以下を設定すると
 +  set -g @resurrect-save 'S'
 +  set -g @resurrect-restore 'R'
 +Key bindingは
 +  prefix + Shift-s - save
 +  prefix + Shift-r - restore
  
 ===== tmux-continuum ===== ===== tmux-continuum =====
 tmux-continuumはTmux Resurrectをサポートするプラグインで自動で保存/復元を可能にする。よってこれらはセットで使うのがよさそう。 tmux-continuumはTmux Resurrectをサポートするプラグインで自動で保存/復元を可能にする。よってこれらはセットで使うのがよさそう。
 +
 +tmux-resurrect が必要です
 +
 +
 +  set -g @plugin 'tmux-plugins/tmux-resurrect'
 +  set -g @plugin 'tmux-plugins/tmux-continuum'
 +
 +==== tcsh@FreeBSD ====
 +tmux-continuumもbashやmacosに依存しているため、ほかの環境だと動作が怪しい
 +で、取り急ぎだがLogin時に自動でtmuxの起動とrestoreを行うように設定してみた
 +
 +<file config ~/.cshrc>
 +ps -ax | grep tmux | grep -v grep | wc -l > /dev/null || bash -c "tmux new -d ~/.tmux/plugins/tmux-resurrect/scripts/restore.sh"
 +</file>
 +
 +
 +
  
 ===== 参考 ===== ===== 参考 =====
serverapps/tmux/plugin.1670057340.txt.gz · 最終更新: 2022/12/03 17:49 by hayashi