I use a Mac, but the instructions provided should also be applicable to the Zsh terminal on Linux.
Terminal Emulator
The default terminal application on Mac OS is good, but there are more feature-rich terminals out there. Personally, I use WezTerm as I found it more performant in certain multiplexer scenarios. You can choose from the following:
Terminal Name | Github Stars | Developed In | Comments |
WezTerm | 10.9 K | Rust | Feature-rich (built-in multiplexer) and cross-platform |
Alacritty | 49.4 K | Rust | Minimal and fast |
Kitty | 20.3 K | C & Python | |
iTerm2 | 14 K | Objective-C | Feels a bit dated, MacOS only |
To install Wezterm, you can download the package from the WezTerm website.
Custom Prompt
When customising the prompt there are a few different ways to go about it.
- oh-my-zsh is a framework for managing zsh configuration including theme and plugins. It offers over 140+ themes.
- Starship is a cross-shell customisable prompt.
- powerlevel10k is a Zsh theme. I use powerlevel10k as it is fast, looks pretty good and is easy to configure using a wizard.
Let’s start by customising the prompt using the powerlevel10k theme.
Install powerlevel10k. I use Homebrew as a package manager, you find the installation instructions specific to your OS on the powerlevel10k GitHub page.
brew install powerlevel10k
echo "source $(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc
Restart the terminal to get into the Powerlevel10k configuration wizard.
![](https://i0.wp.com/umaranis.com/wp-content/uploads/2023/11/image.png?resize=630%2C300&ssl=1)
This is how my prompt looks after going through the wizard.
![](https://i0.wp.com/umaranis.com/wp-content/uploads/2023/11/image-1.png?resize=564%2C153&ssl=1)
And here is the prompt when I am in a git repo.
![](https://i0.wp.com/umaranis.com/wp-content/uploads/2023/11/image-2.png?resize=690%2C188&ssl=1)
Ok. The prompt looks good now.
Auto Suggestion
Now we are going to the configure auto-suggestion. It suggests a completion as we type on the prompt based on history. zsh-autosuggestions is widely used (27.9 K Github stars) to achieve this.
You can find the detailed installation instructions here.
brew install zsh-autosuggestions
echo "source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh" >>~/.zshrc
Restart the terminal to start getting suggestions. Suggestions can be completed using the right arrow.
![](https://i0.wp.com/umaranis.com/wp-content/uploads/2023/11/image-3-1024x217.png?resize=1024%2C217&ssl=1)
Syntax Highlighting
The popular plugin for syntax highlighting is zsh-syntax-highlighting (18K Github stars) but I have found fast-syntax-highlighting (826 Github stars) to be faster and nicer.
brew install zsh-fast-syntax-highlighting
echo "source /opt/homebrew/opt/zsh-fast-syntax-highlighting/share/zsh-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" >>~/.zshrc
It looks so much better now with syntax highlighting.
![](https://i0.wp.com/umaranis.com/wp-content/uploads/2023/11/image-4.png?resize=571%2C133&ssl=1)
Auto-Completion
Auto Completion is a very powerful plugin that provides real-time typeahead completion for popular commands.
Let’s install zsh-autocomplete (4K Github stars).
brew install zsh-autocomplete
echo "source /opt/homebrew/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh" >>~/.zshrc
It can suggest relevant git command options with the explanation.
![](https://i0.wp.com/umaranis.com/wp-content/uploads/2023/11/image-5.png?resize=567%2C295&ssl=1)
You can choose directories using arrow keys based on the context.
![](https://i0.wp.com/umaranis.com/wp-content/uploads/2023/11/image-6.png?resize=570%2C78&ssl=1)
It can suggest available branches to checkout.
![](https://i0.wp.com/umaranis.com/wp-content/uploads/2023/11/image-7.png?resize=570%2C77&ssl=1)
If completion is not working for your favourite command, you can often download and install it from the web.
Homebrew completions can be set up by adding the following to your ~/.zshrc
# add homebrew completions
if type brew &>/dev/null
then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
autoload -Uz compinit
compinit
fi
Check out zsh-completions, it has a lot of additional completions. If you want to install both zsh-completions and Homebrew completions, then follow the instructions here.
zsh-autocomplete (don’t mix with zsh-completions) also provides useful enhancements for working with history.
- Press Ctrl + R to perform a fuzzy history search listing multiple results
- Press the Up arrow to bring up a recent history menu
Great article, I’ll give it a try. I am using https://www.warp.dev/. I think you should include it in your list as it has done AI touch to it.
Hi Roshin,
I have used WARP and like it a lot – its text editing support with OS-like keyboard shortcuts, a touch of AI (like you said) and just all-around great features out-of-the-box.
But I didn’t include it here on purpose because it doesn’t follow the Unix philosophy of `do one thing and do it well`. WARP tries to do everything itself and doesn’t play nice with other tools like multiplexers. Moreover, it is not open source.