Starship
Startship is a "cross-shell prompt", a cool way to customize the look of your shell, but also good to add some helpful information, for example the current git branch, Node or Python versions, and much more...
Installation
Starship is aviable for many operating systems:
- Android
- BSD
- Linux
- macOS
- Windows
and even more shells:
- Bash
- Cmd
- Elvish
- Fish
- Ion
- Nushell
- PowerShell
- Tcsh
- Xonsh
- Zsh
If you can't find yourself at this list, check out the Advanced Installation.
As the Installation Guide is quite good, I will only show the guides for Linux and MacOS.
For any other installation options, or shell, please check the Starship Installation Guide
- Install Starship
curl -sS https://starship.rs/install.sh | sh
# same as linux, or:
brew install starship
- Configure the shell to start Starship
Add these lines to your shell's configuration file:
shell | location | command |
---|---|---|
bash | ~/.bashrc | eval "$(starship init bash)" |
fish | ~/.config/fish/config.fish | starship init fish |
zsh | ~/.zshrc | eval "$(starship init zsh)" |
Elvish | ~/.elvish/rc.elv | eval (starship init elvish) |
Ion | ~/.config/ion/initrc | eval $(starship init ion) |
When you open a new shell, you should now see the new prompt.
- Configure Starship
For customization, check out the Starship Config information.
All Starship configuration is done it the following file (you need to create it first):
~/.config/starship.toml
For more information about TOML, see their Github Repo
My Starship Configuration
starship.toml (Old)
# custom format
format = '''
[┌── $shell─────────────── $memory_usage ──> $nodejs $python](bold green)
[│](bold green)$sudo$username$hostname$localip$directory$character$git_branch$git_metrics$cmd_duration
[└ $battery ─>](bold green) '''
#format = '$all$directory$character'
# Wait 10 milliseconds for starship to check files under the current directory.
scan_timeout = 10
command_timeout = 500
add_newline = true
[shell]
fish_indicator = 'fish'
bash_indicator = 'bash'
unknown_indicator = 'unknwn'
style = 'cyan bold'
disabled = false
[username]
style_user = 'green bold'
format = ' [$user@]($style)'
disabled = false
show_always = true
[sudo]
style = 'bold red'
format = ' [sudo](bold red)'
disabled = false
[python]
symbol = ''
format = 'Python [$version [\($virtualenv\)](dimmed yellow)](bold dimmed green)'
pyenv_version_name = true
detect_files = ['requirements.txt', '__init.py__', 'setup.py']
detect_extensions = ['py']
detect_folders = []
[nodejs]
format = 'Node [$version](bold dimmed green)'
[memory_usage]
disabled = false
threshold = -1
format = '$ram_pct'
symbol = ''
style = 'bold dimmed green'
[localip]
ssh_only = false
format = '[@$localipv4](bold yellow) '
disabled = false
[hostname]
ssh_only = false
ssh_symbol = 'ssh:'
format = '[$ssh_symbol](bold dimmed green)[$hostname](bold dimmed green)'
trim_at = ''
disabled = false
[git_metrics]
disabled = false
format = ' [+$added](bold green)[-$deleted](bold red)'
[git_branch]
format = '[$branch(:$remote_branch)]($style)'
style = 'bold purple'
[fill]
symbol = '-'
style = 'bold green'
# time of command
[cmd_duration]
min_time = 500
format = ' [$duration](bold yellow)'
[directory]
fish_style_pwd_dir_length = 5
disabled = false
truncation_length = 5
truncation_symbol = '…/'
style = 'bold blue'
# promt char
[character]
success_symbol = '[-->](bold green)'
error_symbol = '[-->](bold red)'
# Disable the package module, hiding it from the prompt completely
[package]
disabled = true
# battery
[battery]
full_symbol = '^'
charging_symbol = '+'
discharging_symbol = '-'
[[battery.display]]
threshold = 20
style = 'bold red'
[[battery.display]]
threshold = 50
style = 'bold orange'
[[battery.display]]
threshold = 100
style = 'bold green'
starship.toml (New)
# #
# Starship Config by a3chron, catppuccin theme #
# #
palette = "catppuccin_mocha"
# custom format
format = """
[╭─ $shell─────────────── $memory_usage ──╌╌ $nodejs $python $fill ╌╌─╮](bold overlay0)
[├╌](bold overlay0)$sudo$username$hostname$localip$directory$read_only$git_branch$git_metrics [$fill $cmd_duration ┘](bold overlay0)
[╰─ $battery $character](bold overlay0) """
#format = '$all$directory$character'
# Wait 10 milliseconds for starship to check files under the current directory.
scan_timeout = 10
command_timeout = 500
add_newline = true
# Catppuchin Theme
[palettes.catppuccin_mocha]
rosewater = "#f5e0dc"
flamingo = "#f2cdcd"
pink = "#f5c2e7"
mauve = "#cba6f7"
red = "#f38ba8"
maroon = "#eba0ac"
peach = "#fab387"
yellow = "#f9e2af"
green = "#a6e3a1"
teal = "#94e2d5"
sky = "#89dceb"
sapphire = "#74c7ec"
blue = "#89b4fa"
lavender = "#b4befe"
text = "#cdd6f4"
subtext1 = "#bac2de"
subtext0 = "#a6adc8"
overlay2 = "#9399b2"
overlay1 = "#7f849c"
overlay0 = "#6c7086"
surface2 = "#585b70"
surface1 = "#45475a"
surface0 = "#313244"
base = "#1e1e2e"
mantle = "#181825"
crust = "#11111b"
[shell]
fish_indicator = 'fish'
bash_indicator = 'bash'
unknown_indicator = 'unknwn'
style = 'peach'
disabled = false
[username]
style_user = 'peach bold'
format = ' [$user@]($style)'
disabled = false
show_always = true
[sudo]
format = ' [sudo](bold red)'
disabled = false
[python]
symbol = ''
format = '[Python](bold green) [$version [\($virtualenv\)](dimmed green)](bold dimmed green)'
pyenv_version_name = true
detect_files = ['requirements.txt', '__init.py__', 'setup.py']
detect_extensions = ['py']
detect_folders = []
[nodejs]
format = '[Node](bold lavender) [$version](bold dimmed lavender)'
[memory_usage]
disabled = false
threshold = -1
format = '[$ram_pct]($style)'
symbol = ''
style = 'dimmed peach'
[localip]
ssh_only = false
format = '[@$localipv4](bold overlay0) '
disabled = false
[hostname]
ssh_only = false
ssh_symbol = 'ssh:'
format = '[$ssh_symbol](bold dimmed maroon)[$hostname](bold dimmed peach)'
trim_at = ''
disabled = false
[git_metrics]
disabled = false
format = ' [+$added](bold green)[-$deleted](bold red)'
[git_branch]
format = '[$branch(:$remote_branch)]($style)'
style = 'bold mauve'
[fill]
symbol = ' '
style = 'bold base'
# time of command
[cmd_duration]
min_time = 500
format = ' [$duration](bold yellow)'
[directory]
fish_style_pwd_dir_length = 5
disabled = false
truncation_length = 5
truncation_symbol = '…/'
read_only = ' read-only'
read_only_style = 'bold dimmed teal'
style = 'bold teal'
# promt char
[character]
success_symbol = '[──╌╌](bold overlay0)'
error_symbol = '[──╌╌](bold red)'
# Disable the package module, hiding it from the prompt completely
[package]
disabled = true
# battery
[battery]
full_symbol = '◉ '
charging_symbol = '⦿ '
discharging_symbol = '⦾ '
[[battery.display]]
threshold = 20
style = 'red'
[[battery.display]]
threshold = 100
style = 'peach'