Skip to content

Instantly share code, notes, and snippets.

@zsimic
Created December 17, 2020 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zsimic/56159dff3a6c55b21573a974e2c8cf07 to your computer and use it in GitHub Desktop.
Save zsimic/56159dff3a6c55b21573a974e2c8cf07 to your computer and use it in GitHub Desktop.
startship.toml
# My config for https://starship.rs/
# It's minimalistic, I like single-line prompts, features:
# - show active python version when non-system python is on PATH
# - show duration only when last command took more than 5s
format="$cmd_duration$custom$directory$character"
add_newline = false
[directory]
format = "[$path]($style)[$read_only]($read_only_style)"
style = "yellow"
truncate_to_repo = false
truncation_length = 5
truncation_symbol="…/"
[character]
success_symbol = "[:](bold green)"
error_symbol = "[:](bold red)"
# Show duration for commands that took more than 5s only
[cmd_duration]
format = "[took $duration]($style)\n"
min_time = 5000
show_milliseconds = false
style = "dimmed"
# Using a custom format to highlight current non-system python in a compact manner
# - 🐍: python from virtual env is active
# - 🦎: python from pyenv is active
[custom.py]
command = """ pv=$(python --version | grep -Eo "\\d+\\.\\d+"); if [ -n "$VIRTUAL_ENV" ]; then echo "🐍 $pv"; else echo "🦎 $pv"; fi """
format = "[$output]($style) "
style = "blue"
when = """ test -n "$VIRTUAL_ENV" || echo $PATH | grep /pyenv/ """
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment