- Published on
Setup your fancy terminal
- Authors
- Name
- Tong
Using your shell with Oh My Zsh and Starship on macOS
Some use fish shell as it is an interactive, user-friendly, and modern shell. But it does not have POSIX sh compatibility. Using fish as your default shell could break part of your system. In this post, I will focus on zsh. With powerful plugins. You can have a powerful interactive interface.
Z shell (zsh)
InstallFor macOS:
brew install zsh
For Ubuntu:
sudo apt install zsh
Oh My Zsh (omz)
Installsh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Set zsh as your default shell
chsh -s $(which zsh)
Oh My Zsh plugins
InstallClone zsh-autosuggestions, zsh-syntax-highlighting and zsh-completions.
git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-completions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions
Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc):
plugins=(
# other plugins...
zsh-autosuggestions
zsh-syntax-highlighting
zsh-completions
)
Starship.rs (a fast fancy prompt written in Rust)
You need Nerd Font installed and enabled in your terminal.
We will install Fira Code Nerd Font.
For macOS:
brew tap homebrew/cask-fonts
brew install --cask font-fira-code-nerd-font
Open your terminal preferences and enable the font you've just downloaded.
⌘,
For Ubuntu:
sudo apt install fonts-firacode
For macOS and Ubuntu:
Add the following to the end of ~/.zshrc
:
eval "$(starship init zsh)"