Home

A nicer terminal on Linux and macOS — zsh, oh-my-zsh and powerlevel10k

The default Linux/macOS terminal does the job, but it's plain. Plain isn't bad, just plain. A few tweaks turn it into something that actually helps you work — coloured syntax, smart completions, a prompt that tells you what git branch you're on without needing to type git status.

This is the setup I've been running for years. Walkthrough below for both Linux (apt-based) and macOS.

Install zsh

Ubuntu / Debian:

bash
sudo apt install zsh

macOS already ships with zsh as the default shell, so we just need the Powerline fonts:

bash
git clone https://github.com/powerline/fonts.git --depth=1cd fonts./install.shcd ..rm -rf fonts

Install oh-my-zsh

Same on Linux and macOS:

bash
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

When it asks if you want to make zsh your default shell, say yes.

Theme: powerlevel10k

bash
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Open ~/.zshrc and set the theme:

bash
vim ~/.zshrc
properties
ZSH_THEME="powerlevel10k/powerlevel10k"

Save, restart zsh, and the powerlevel10k configuration wizard will run. Pick the options you like — this is where you decide how the prompt looks.

If it warns about missing icons, say yes to installing the recommended fonts (MesloLGS NF). Without them you'll get little square boxes where the icons should be.

You can re-run the wizard any time:

bash
p10k configure

Plugins worth having

zsh-autosuggestions

Suggests completions in dim grey based on your history. Hit to accept.

bash
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

zsh-syntax-highlighting

Colours your command line as you type — valid commands in green, broken ones in red. Catches typos before you hit enter.

bash
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

Enable them

Edit ~/.zshrc and add the plugins to the list:

bash
vim ~/.zshrc
properties
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

Save, restart zsh, done.

Showing CPU and RAM in the prompt

If you want CPU load and free RAM in the right side of the prompt, edit the powerlevel10k config:

bash
vim ~/.p10k.zsh

Find POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS and uncomment:

bash
#load                  # CPU load#ram                   # free RAM

That's the setup. Happy hacking 🙂

References