easy movement and management tmux session.
1 repository 1 tmux session is good bad not best.
- sessions management is not easy if you open many sessions
- tmux default move is hard to use (for me. i wanna use fzf)
- tmux has
tmux swich-clientandtmux attatch-session. there are in or out of tmux 😭
so, i made ghux.
- can switch with built-in fuzzy search UI
- auto setting session name
- ghux is one command then in or out of tmux 😂
- No need to consider whether there is a destination session
tmuxを1セッション1リポジトリで運用する上でのつらみ
- セッション管理が大変
- tmuxのデフォルトの移動機能はいまいち(あいまい検索で移動したい)
- コマンドでやろうとするとtmux内かtmux外かでコマンドを変える必要がある
いい感じにするスクリプトghux
- Go内蔵のあいまい検索UIでセッションを移動可能
- セッション名も自動で設定してくれる
- tmuxにすでにアタッチしているか否かを考える必要がない
- 移動先のセッションが存在するかどうか考えずに移動が可能(もしセッションが存在しなければ自動でつくる)
ただし現状ではセッション名でアタッチ先を管理しているのでセッション名を変えられない
- go (build時)
- tmux
- ghq (optional)
Build binary
go build -o ghux ./cmd/ghux対話選択:
$ ghux
alias指定:
$ ghux dotfiles~/.ghux_aliases:
<alias>,<name>,<path>
例:
dotfiles,dotfiles,$HOME/dotfiles
$XDG_CONFIG_HOME/ghux/config.toml (default: ~/.config/ghux/config.toml)
aliases_path = "~/.ghux_aliases"
recent_path = "~/.cache/ghux/recent"
recent_limit = 10
dotfiles_option = falseenvでも上書き可能:
GHUX_CONFIGGHUX_ALIASES_PATHGHUX_RECENT_PATHGHUX_RECENT_LIMITGHUX_DOTFILES_OPTION
ghqにてリポジトリを管理している場合、ghux_aliasesを登録する必要なく
開きたいリポジトリのセッションを立ち上げる/アタッチする事が可能(しかもすでにセッションが立ち上がってるか意識する必要なしに!)
~/.ghux_aliasesにghuxのaliasを登録することができる。
形式は<alias>,<名前>,<ファイルパス>
aliasに登録してないけど開いたtmux sessionもよしなに管理したい
MIT ©️ 2357gi

