Awesome Starship Prompt
· 2 min read
The minimal, blazing-fast, and infinitely customizable prompt for any shell!
🌟 Key Features
-
Universal Shell Support
- Works with any shell
- Consistent experience
- Cross-platform compatibility
- Easy configuration
-
Performance
- Written in Rust
- Asynchronous execution
- Minimal overhead
- Smart caching
-
Customization
- TOML configuration
- Modular design
- Custom commands
- Conditional rendering
-
Smart Defaults
- Intelligent module activation
- Context-aware display
- Sensible fallbacks
- Auto-detection
⚡ Quick Start
# Installation
curl -sS https://starship.rs/install.sh | sh
# Add to your shell config (~/.zshrc, ~/.bashrc, etc.)
eval "$(starship init zsh)" # or bash, fish, etc.
🎨 Essential Configuration
# ~/.config/starship.toml
# Performance-Optimized Setup
format = """$directory$git_branch$git_status$nodejs$python$character"""
command_timeout = 1000
scan_timeout = 100
[directory]
style = "blue bold"
truncation_length = 3
truncate_to_repo = true
read_only = " "
[character]
success_symbol = "[❯](purple)"
error_symbol = "[❯](red)"
vicmd_symbol = "[❮](green)"
[git_branch]
format = "[$branch]($style) "
style = "bright-black"
[git_status]
format = '([\[$all_status$ahead_behind\]]($style) )'
style = "cyan"
ahead = "⇡"
behind = "⇣"
diverged = "⇕"
modified = "!"
staged = "+"
renamed = "»"
deleted = "✘"
[nodejs]
format = "[$version]($style) "
style = "green"
detect_files = ["package.json", ".nvmrc"]
detect_extensions = ["js", "mjs", "cjs", "ts", "mts", "cts"]
[python]
format = "[$version]($style) "
style = "yellow"
detect_extensions = ["py"]
python_binary = ["python3", "python"]
# Disable unused modules for performance
[aws]
disabled = true
[gcloud]
disabled = true
[kubernetes]
disabled = true
[docker_context]
disabled = true
[package]
disabled = true
[ruby]
disabled = true
[java]
disabled = true
[golang]
disabled = true
[php]
disabled = true
[haskell]
disabled = true
[swift]
disabled = true
[rust]
disabled = true
🎯 Module Configuration
-
Directory Module
[directory]
truncation_length = 3
truncate_to_repo = true
fish_style_pwd_dir_length = 1
use_logical_path = true -
Git Module
[git_branch]
symbol = " "
truncation_length = 4
truncation_symbol = ""
ignore_branches = ["master", "main"] -
Language Versions
[nodejs]
format = "via [ $version](bold green) "
detect_extensions = ["js", "mjs", "cjs", "ts", "mts", "cts"]
[python]
format = "via [ $version]($style) "
detect_extensions = ["py"]
🚀 Pro Tips
-
Performance Optimization
- Disable unused modules
- Use minimal format string
- Set appropriate timeouts
- Cache aggressively
- Use async rendering
-
Style Guide
# Consistent colors
[git_branch]
style = "242"
[git_status]
style = "cyan"
[directory]
style = "blue" -
Error Handling
[character]
error_symbol = "[✗](bold red)"
success_symbol = "[❯](bold green)"
vicmd_symbol = "[❮](bold green)"
🔧 Troubleshooting
-
Common Issues
- Font problems: Install Nerd Fonts
- Performance: Check module timeouts
- Missing icons: Verify terminal support
- Shell integration: Check initialization
-
Debugging
# Enable debug logs
STARSHIP_LOG=debug starship explain
# Check configuration
starship config
# Profile startup time
STARSHIP_LOG=trace starship explain 2>&1 | grep "took"
🎨 Theme Examples
-
Minimal Development
format = """$directory$git_branch$character""" -
Full Stack
format = """
$username@$hostname
$directory$git_branch$git_status
$nodejs$python$rust
$character""" -
DevOps
format = """
$directory$git_branch
$kubernetes$docker$aws
$character"""
🔄 Integration
-
Terminal Emulators
- iTerm2
- Alacritty
- Windows Terminal
- Kitty
-
Color Schemes
- Dracula
- Nord
- Solarized
- One Dark
-
Fonts
- JetBrains Mono
- Fira Code
- Hack
- Source Code Pro
