DEV Community

Cover image for Custom terminal with oh-my-zsh and starship
Du Hoang
Du Hoang

Posted on

Custom terminal with oh-my-zsh and starship

My setup

  • OS: macOS Monterey 12.5.1
  • Editor: Visual Studio Code
  • Theme: Bearded Theme HC Ebony

oh-my-zsh and nerd-font

Your ~/.zshrc file should have these lines

export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="simple"
source $ZSH/oh-my-zsh.sh
Enter fullscreen mode Exit fullscreen mode

Starship

  • Install starship

  • Edit your ~/.zshrc file using this command

nvim ~/.config/starship.toml
Enter fullscreen mode Exit fullscreen mode

or

nano ~/.config/starship.toml
Enter fullscreen mode Exit fullscreen mode
  • Add the following to the end of your ~/.zshrc file
eval "$(starship init zsh)"
Enter fullscreen mode Exit fullscreen mode

The default starship will look like this
The default starship

Config

starship preset no-runtime-versions -o ~/.config/starship.toml
Enter fullscreen mode Exit fullscreen mode
  • Add these configs to the top of the ~/.zshrc file
"$schema" = 'https://starship.rs/config-schema.json'

add_newline = false

[line_break]
disabled = true

[character] 
success_symbol = '[➜](bold green)'
error_symbol = "[➜](red)"
vicmd_symbol = "[❮](green)"
Enter fullscreen mode Exit fullscreen mode

Final ~/.config/starship.toml file should be like this

Final ~/.config/starship.toml` file

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more