miseでdotfilesを管理する
公開
miseでdotfilesを管理できるようになっていたので試してみた。
管理といっても $HOME/.config などにシンボリックリンクを張るだけだが。(dotfilesのリポジトリ自体を管理する機能もあるみたい) それでも、同じことをするスクリプトを書いたりメンテしたりするのはだるいので、miseの設定ファイルで完結できるのはうれしい。
設定
config.toml に記述する。左辺の値がシンボリックの作成先で、右辺の source に実際のフォルダやファイルがあるパスを記述する。
[dotfiles]
"~/bin" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/bin" }
"~/prh.yml" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/prh/prh.yml" }
"~/.swift-format" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/swift-format/.swift-format" }
"~/.textlintrc" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/textlint/.textlintrc" }
"~/.vim" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/vim" }
"~/.zshenv" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/zsh/.zshenv" }
"~/.config/bundle" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/bundle" }
"~/.config/ctags" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/ctags" }
"~/.config/git" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/git" }
"~/.config/hunk" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/hunk" }
"~/.config/mise" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/mise" }
"~/.config/nvim" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/nvim" }
"~/.config/prh" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/prh" }
"~/.config/rubocop" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/rubocop" }
"~/.config/textlint" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/textlint" }
"~/.config/tig" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/tig" }
"~/.config/tmux" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/tmux" }
"~/.config/trf" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/trf" }
"~/.config/vim" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/vim" }
"~/.config/wezterm" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/wezterm" }
"~/.config/zsh" = { source = "~/ghq/github.com/pupepa/dotfiles/configs/zsh" }
チェック
以下のコマンドを実行することで、実際のシンボリックリンクの作成状況を確認できる。
mise bootstrap dotfiles status
実行
mise bootstrap dotfiles apply
おわりに
miseがどんどん便利になる。dotfilesのリポジトリを管理する機能