3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

oh-my-zsh から starship に乗り換える

Last updated at Posted at 2021-03-29

概要

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

結果

上記設定のプロンプト

スクリーンショット 2021-03-30 1.28.44.png

所感

利点として、ターミナルで新タブ開く時や、コマンド実行時の wait がゼロコンマ程度だけど早くなった。
また、プロンプトをカスタムする意欲も少し湧いてくる。

欠点として、使用不可になった機能がある。

  • コマンド alias
    • ll etc?...
  • タブによるサジェスト
    • カレントディレクトリのファイル選択
    • ssh 実行時の .ssh/config 設定
    • 大文字小文字を無視

カスタマイズ

とりあえず、以下を参考に設定した。

リファレンス見て調整するの良いかも
zsh: The Z Shell Manual
Zsh - ArchWiki

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?