Skip to main content

Starship

The minimal, blazing-fast, and infinitely customizable prompt for any shell!

Requirements​

Install fonts on Ubuntu​

  1. Download and Install:

    Script to download, install, and activate JetBrains Mono Nerd Font on Ubuntu
    #!/usr/bin/env bash
    set -e

    FONT_NAME="JetBrainsMono"
    FONT_URL="https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/JetBrainsMono.zip"
    INSTALL_DIR="$HOME/.local/share/fonts/$FONT_NAME-Nerd"

    echo "Starting installation of $FONT_NAME Nerd Font..."

    # Create installation directory
    mkdir -p "$INSTALL_DIR"

    # Download the zip file
    TEMP_ZIP="$(mktemp /tmp/JetBrainsMono.XXXXXX.zip)"
    echo "Downloading $FONT_NAME Nerd Font..."
    curl -L -o "$TEMP_ZIP" "$FONT_URL"

    # Unzip font files into the installation directory
    echo "Extracting font files..."
    unzip -o "$TEMP_ZIP" -d "$INSTALL_DIR"

    # Remove temporary zip
    rm "$TEMP_ZIP"

    # Refresh font cache
    echo "Refreshing font cache..."
    fc-cache -fv

    # Verify installation
    echo "Installed fonts:"
    fc-list | grep "JetBrainsMono"

    echo "Installation complete!"
    echo "You can now set 'JetBrainsMono Nerd Font' in your terminal preferences (GNOME Terminal, Alacritty, Kitty, etc.)"
  2. Set Font in Terminal:

    Once installed, configure your terminal to use the font.

    • GNOME Terminal: Preferences β†’ Profile β†’ Text β†’ Custom font β†’ JetBrainsMono Nerd Font
  3. Test Nerd Font Icons:

    To check if the Nerd Font icons are working, run:

    echo "ξ‚° ξ‚  ξ˜‚ ο„‘ "
    • If the icons display correctly (not as boxes or question marks), your font is installed and working.
  4. Notes:

    • The installation is per-user by default. To install system-wide, copy fonts to /usr/local/share/fonts/.
    • The font works well with Oh My Zsh, Starship, Powerlevel10k, and modern code editors (VS Code).

Install fonts on Windows​

  1. Download the Font
  2. Extract the .zip file.
  3. Right-click on all .ttf files β†’ Install (or Install for all users).
  4. Configure Your Terminal
    • Windows Terminal (WSL profile):

      1. Open WSL -> Right click on WSL window -> Properties -> Font
      2. Set Font to JetBrainsMono
      3. Click OK
    • VS Code + WSL:

      "editor.fontFamily": "JetBrainsMono Nerd Font",
      "terminal.integrated.fontFamily": "JetBrainsMono Nerd Font",

Custom configuration​

~/.config/starship.toml
# ~/.config/starship.toml

# General prompt settings
add_newline = false
format = """
$username\
$hostname\
$time\
$python\
$directory\
$kubernetes\
$git_branch\
$git_state\
$git_status\
$cmd_duration\
$line_break\
$character"""

# Prompt symbols
[character]
success_symbol = "[➜](bold green)"
error_symbol = "[βœ—](bold red)"

# Hostname module
[hostname]
ssh_only = false
format = '@[$hostname]($style): '
style = 'red'
disabled = false

# User module
[username]
style_user = 'green'
style_root = 'black'
format = '󱩊 [$user]($style)'
disabled = false
show_always = true

# Time module
[time]
disabled = true
format = "[$time]($style) "
style = "dimmed white"
time_format = "%T"

# Directory module
[directory]
style = "blue"
truncation_length = 3
truncation_symbol = '…/'
truncate_to_repo = true

# Git branch module
[git_branch]
format = '[$symbol$branch(:$remote_branch)]($style) '
symbol = "ξ‚  "
style = "purple bold"

# Git status module
[git_status]
staged = "[+](green)"
untracked = "[?](blue)"
modified = "[*](yellow)"
conflicted = "[=](red)"
ahead = "⇑(red)"
behind = "[⇣](red)"
style = 'blue'

# Git state module
[git_state]
style = 'yellow'
disabled = false

# Kubernetes module
[kubernetes]
format = '\([$symbol$context(::$namespace)]($style)\) '
symbol = ' '
detect_files = ['helmfile.yaml']
disabled = false

# Python module
[python]
disabled = false
format = '[(${version} )(\($virtualenv\) )]($style)'
style = "yellow"
pyenv_version_name = true

# Command duration
[cmd_duration]
min_time = 500
format = "σ°…‘ [$duration]($style) "
style = "yellow"