Starship on Zsh

Sep 23, 2024·
Alfonso Fortunato
Alfonso Fortunato
· 1 min read
zettelkasten

Starship Configuration

Since powerlevel10k is now at its end of life, I decided to set up a configuration with Starship, which seems promising in terms of performance and customization. You can check out the official Starship site for more information.

To install Starship, you can run:

curl -sS https://starship.rs/install.sh | sh

Next, initialize Starship in the .zshrc:

eval "$(starship init zsh)"
export STARSHIP_CONFIG=~/.config/starship/starship.toml

Configuration

The configuration is quite straightforward. There’s a format global variable that defines the overall look of the prompt. In my case, I decided to try out the new feature that allows setting the prompt on the right side:

format defines the left part of the prompt:

  • format = “”"$directory$character"""

right_format defines the right side of the prompt:

  • right_format = “”"$all"""

Then, you can define the global palette by selecting from pre-existing presets,(here)

  • palette = “gruvbox_dark”

Each module has a format option to customize its appearance in the prompt. For example, here’s how to customize the AWS module:

[aws]
format = '[$symbol(profile: "$profile" )(\(region: $region\) )]($style)'
disabled = false
style = 'bold blue'
symbol = " "

In this example, the style is referenced within the format using $style. Every variable starts with a dollar sign ($), making the configuration flexible and highly customizable. For the full configuration: Starship Configuration

Alfonso Fortunato
Authors
DevSecOps Engineer

Hi, I’m a DevSecOps Engineer who thrives at the intersection of development, security, and operations. My journey started as a Full Stack Developer, but I quickly found my calling in the infrastructure side of things, transitioning to a DevOps/Cloud Engineer role within my first year. That shift opened the door to the world of CI/CD pipelines, Kubernetes, and cloud-native technologies, and I never looked back. Today, I focus on building secure, automated, and reproducible infrastructure. I’m a firm believer in Open Source and actively contribute to the community that shaped my career.

Never Stop Learning