DEV Community

0xkoji
0xkoji

Posted on β€’ Edited on

4

How to switch from Oh My Zsh to starship πŸš€

I switched from Oh My Zsh to starship since I started learning rust 😁 πŸ¦€

Image description

Step 0 Install homebrew if you don't have already

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode

https://docs.brew.sh/Installation

Step 1 Delete Oh My Zsh

First, remove Oh My Zsh. When you remove Oh My Zsh, your .zshrc will be archived.

uninstall_oh_my_zsh
Enter fullscreen mode Exit fullscreen mode

Step 2 Install starship

brew install starship
Enter fullscreen mode Exit fullscreen mode

Step 3 Add the setting to .zshrc

Add the following to your .zshrc

 eval "$(starship init zsh)"
Enter fullscreen mode Exit fullscreen mode

Step 4 Add a font

You can use the following font to avoid the character corruption.

https://github.com/ryanoasis/nerd-fonts#font-installation

Step 5 Create a config file for starship

Lastly we will need to create a toml file to configure starship settings

mkdir -p ~/.config && touch ~/.config/starship.toml
Enter fullscreen mode Exit fullscreen mode

You can find out the details here

My starship.toml
The latest version is here.

[aws]
disabled = true

[character]
format = "❯❯ "
success_symbol = "❯❯(bold green) "
error_symbol = "❯❯(bold red) "

[directory]
format = "[$path]($style)[$read_only]($read_only_style) "
truncation_length = 4
truncate_to_repo = false
truncation_symbol = "…/"

[git_status]
disabled = true

[hostname]
disabled = true

# Disable the package module, hiding it from the prompt completely
[package]
disabled = true

[time]
disabled = false
time_format = "%Y-%m-%d %H:%M"
utc_time_offset = "local"

[username]
style_root = "green bold"
format = "😈 [$user]($style) "
disabled = false
show_always = true

[git_branch]
symbol = "πŸ’» "
truncation_length = 20
truncation_symbol = "…"
style="bold purple"

[rust]
format = "via [βš™οΈ $version](bold red)"

[python]
pyenv_version_name = true

[nodejs]
format = "via [πŸ€– $version](bold green) "
Enter fullscreen mode Exit fullscreen mode

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

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

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay