概要
zsh 移行時にとりあえず oh-my-zsh にしたけど、 .zshrc が賑やかなので、starship に移行した。
削除手順
oh-my-zsh アンインストール
uninstall_oh_my_zsh
.zshrc を再生成
既存の .zshrc は、同ディレクトリにアーカイブされる。
そのため、新たに生成する必要あり。
留意事項として、既存の .zshrc に export PATH="..." など独自設定がある場合、移行しておく。
~/.zshrc
# ...snip...
starship インストール
$ brew install starship
.zshrc 設定
~/.zshrc
+ eval "$(starship init zsh)"
フォントの文字化け修正
nerd-font インストール
ターミナルのフォント設定 ( iTerm2 )
DroidSansMono Nerd Font を選択した。
starship の設定ファイル生成
$ mkdir -p ~/.config && touch ~/.config/starship.toml
好みにカスタマイズ
[aws]
disabled = true
[character]
format = "❯❯ "
success_symbol = "❯❯(bold green) "
error_symbol = "❯❯(bold red) "
[directory]
format = "[$path]($style)[$read_only]($read_only_style) "
truncation_length = 4
truncate_to_repo = false
truncation_symbol = "…/"
[git_status]
disabled = true
[hostname]
disabled = true
# Disable the package module, hiding it from the prompt completely
[package]
disabled = true
[time]
disabled = false
time_format = "%Y-%m-%d %H:%M"
utc_time_offset = "+9"
[username]
disabled = true
結果
上記設定のプロンプト
所感
利点として、ターミナルで新タブ開く時や、コマンド実行時の wait がゼロコンマ程度だけど早くなった。
また、プロンプトをカスタムする意欲も少し湧いてくる。
欠点として、使用不可になった機能がある。
- コマンド alias
-
lletc?...
-
- タブによるサジェスト
- カレントディレクトリのファイル選択
- ssh 実行時の .ssh/config 設定
- 大文字小文字を無視
カスタマイズ
とりあえず、以下を参考に設定した。
リファレンス見て調整するの良いかも
zsh: The Z Shell Manual
Zsh - ArchWiki
