DEV Community

0xkoji
0xkoji

Posted on • Updated on

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

Top comments (0)