Supercharging Your Terminal [Updated 25/11/2023]
Merry Christmas everyone π π»π
For today’s blog post, I am re-publishing an article I originally wrote for my company blog on 7th May 2017.
In all likelihood, since I started using a Mac, I have been using the stock Terminal with the Pro theme. This has mostly suited me well, but there are a handful of things I always thought could be improved.
Inspired by a blog post and a colleague at work who recently showed me their shell, reignited my interest in updating my setup. This article is the result of the steps I used to set up my terminal.
-
Install the excellent iTerm2 which brings some nifty features.
-
On newer versions of macOS, simply update the version of
zsh
by:
brew install zsh zsh-completions
- On older versions of macOS (before Catalina I believe), set up
zsh
as the default shell. Snipped from the setup instructions:
brew install zsh zsh-completions
echo "/usr/local/bin/zsh" >> /etc/shells
chsh -s $(which zsh)
- Install oh-my-zsh:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- Download and Install Powerline Fonts:
git clone [email protected]:powerline/fonts.git
./install.sh
-
Change font used in iTerm2:
- Navigate to
Profiles
- Then
Text
- Choose
Roboto Mono Light for Powerline
- Bump the default font size to
14
- Navigate to
-
Edited my
~/.zsh
file:- Change
ZSH_THEME
from the default to ‘powerlevel10k/powerlevel10k’
- Change
-
Add
DEFAULT_USER="<your username>"
to stop seeing user@host -
Update the plugins so
plugins=(git git-flow git-extras web-search)
-
Changed colour present in iTerm2 to ‘Darkside’
Once all this is done, this is what your shell should look like:
You can see the time, current working directory and git status in my prompt. Also, notice the git status showing the current branch master
, tag v0.3
, the β
representing changes and lastly the ?
to signify a new file. Pretty cool, huh?
Update: Found this interesting counter article since posting
Update 2: Installing the Shell Integration enables extremely handy shortcuts like Cmd+Shift+A to select previous commands output and Auto Command Completion
Update 3: zsh
is now the default shell in macOS, so clarified that switching shells only relates to the older versions
Update 4: Clarify font settings in iTerm2
Update 5: Update ZSH theme to Powerlevel10k