コンテンツにスキップ

Starship

Starship は cross-shell の prompt。Git status、言語 version、実行時間などを表示する。10 種類の theme palette を切り替え可能。

Terminal
~/projects/myapp main ✓ ⬢20.10.0 🐹1.213s

左から: directory, git branch, git status, 言語 version。右側に実行時間と exit status。

Module表示
Directorypath (3 segment まで、icon 付き置換)
Git branchbranch 名 (20 文字で truncate)
Git statusahead/behind, modified, staged, untracked, conflict
Node.js + version
Rust🦀 + version
Go🐹 + version
Python🐍 + version
Docker🐳 + context
TimeHH:MM
Duration500ms 以上の command のみ表示
Statusexit code (非ゼロのみ)
Icon意味
up to date
conflict
⇡NN commits ahead
⇣NN commits behind
+NN untracked files
!NN modified files
●NN staged files
»NN renamed files
✘NN deleted files
stash あり

特定の directory 名を icon に置換して短く表示する。

DirectoryIcon
Documents
Downloads
Music
Pictures
Developer
.config

palette = "catppuccin" で active palette を切り替える。10 種類の palette を定義済み。

Palette雰囲気
Catppuccinwarm な pastel 系
Nordcool な arctic palette
Draculadark purple 系
Tokyo Nightdeep blue + vibrant
Gruvboxearthy warm tone
Everforestsoft green 系
One DarkVS Code 風
Rosé Pinemuted pink/blue
Solarized定番の dual-tone
Kanagawa日本画風 muted color

各 palette は pink, red, yellow, green, sky, sapphire, blue, overlay2 の 8 色を定義。module の style がこれらの色名を参照する。

theme-switch コマンドで palette 名を切り替える。Starship は config の変更を自動で検知するため、prompt を開き直せば反映される。

Terminal window
~/.config/starship/starship.toml

command_timeout は 2000ms に設定 (default の 500ms だと git 操作が timeout しやすい)。