December 11th, 2019

Zsh and Starship on macOS

Zsh + Starship

Switch to Zsh

Starting with macOS Catalina, your Mac uses zsh as the default login shell and interactive shell.

I have nothing against Zsh so let's use it. If your macOS still use Bash, you can switch to Zsh using a single command:

chsh -s /bin/zsh

I used Fish with Spaceship and some plugins. It worked but I wanted to try something new. Starship. Why?

  1. I like the simplicity, the less installation and configuration the better. It's easier to install Spacefish instead of Fish, OhMyFish and additional plugins.
  2. Bash/Zsh are more popular and almost all scripts will work without any changes.
  3. Starship works with any shell.

Install Starship

brew install starship

Edit ~/.zshrc and add at the end of the file:

eval "$(starship init zsh)"

Install a Powerline font:

brew cask install font-fira-code

Enable the Fira Code font in your terminal.

Install autosuggestions

The autosuggestions are the feature I like the most in Fish. To achieve similar functionality in Zsh, we can use zsh-autosuggestions.

brew install zsh-autosuggestions

Add the following to ~/.zshrc file:

source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

Done! I have Zsh so all scripts and commands work. I have a nice theme from Starship which looks like my previous Fish configuration. I have autosuggestions (almost) like in Fish!

Setup time: 2min.

Do you want to support me?

© 2019 Przemysław Kołodziejczyk