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:
sudo apt install zshmacOS already ships with zsh as the default shell, so we just need the Powerline fonts:
git clone https://github.com/powerline/fonts.git --depth=1cd fonts./install.shcd ..rm -rf fontsInstall oh-my-zsh
Same on Linux and macOS:
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
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10kOpen ~/.zshrc and set the theme:
vim ~/.zshrcZSH_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:
p10k configurePlugins worth having
zsh-autosuggestions
Suggests completions in dim grey based on your history. Hit → to accept.
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestionszsh-syntax-highlighting
Colours your command line as you type — valid commands in green, broken ones in red. Catches typos before you hit enter.
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlightingEnable them
Edit ~/.zshrc and add the plugins to the list:
vim ~/.zshrcplugins=(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:
vim ~/.p10k.zshFind POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS and uncomment:
#load # CPU load#ram # free RAMThat's the setup. Happy hacking 🙂