Customized Shell Prompt with Starship hero

Customized Shell Prompt with Starship

Starship is a minimal, blazing-fast, and infinitely customizable prompt for any shell. I’ve been interviewing developers recently and the majority of them are using Starship! It’s easy to setup and configure. Here’s how to get started.

Install

Install starship by running the following brew command.

Terminal window
brew install starship

Now that starship is installed, you have to source it in your config.fish by adding the following line.

~/.config/fish/config.fish
starship init fish | source

Configuration

To configure starship, create a ~/.config/starship.toml and add the following content.

First, swap out some of the characters with custom Nerd Font options. You can find more on Nerd Font’s website.

~/.config/starship.toml
[character]
success_symbol = "[\uf054](white)" # 
vicmd_symbol = "[\ue62b](white)" # 
error_symbol = "[\uf467](red)" # 

Next, I prefer changing the directory name to blue, since we’ll be updating tmux in a future post to the same color as well, creating a consistent style.

~/.config/starship.toml
[directory]
style = "blue bold"

Finally, I prefer a more minimal approach to my prompt, so I prefer disabling many of the built in modules.

~/.config/starship.toml
[package]
disabled = true
[username]
disabled = true
[hostname]
disabled = true
[aws]
disabled = true
[docker_context]
disabled = true
[git_branch]
disabled = true
[git_commit]
disabled = true
[git_state]
disabled = true
[git_metrics]
disabled = true
[git_status]
disabled = true

Check out all the configuration options to figure out which modules you can configure or customize to your liking.

Summary

That’s it! Starship works great out-of-the-box and has a low learning-curve. It is smart and will provide contextual information related to where you are in the terminal. With a few customizations it has a minimal and consistent look making it a great addition to my dev workflow.

Sign-Up for New Posts

Stay in the loop and get the latest blog posts about dotfiles sent to your inbox.

Or use the

RSS Feed
man sitting at desk in front of a landscape of rivers leading to a mountain range

Dev Workflow Intro

Your guide to creating a powerful and intuitive development workflow in the terminal.

The terminal is a powerful tool for developers, but it can be overwhelming to know where to start. This guide will help you create a powerful development environment in the terminal. Here are some of the things you'll learn.

  • Install packages and keep them up-to-date
  • Design a minimalist, distraction-free, user-interface
  • Use familiar keyboard shortcuts
  • Manage multiple projects with ease
  • Integrate with Git and GitHub
Get Started