I recently installed my new MacBook and set up my terminal. Here I'll show you how to do the same for your MacBook.
The final result
This is the end result based on the delicious powerlevel10k. Easy to configure and modify. Optimized to work as a developer.
You will notice the toolbar at the top (Cpu, Ram, Network) to always have an overview of the hardware consumption.
Prerequisites
Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install iTerm2 and git
brew install --cask iterm2
brew install git
Install Oh My Zsh
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Theme installation
I choosed powerlevel10k probably one of the best and most flexible theme you can choose.
You can easily change your terminal layout simply by rerun the installation command.
Start to install MesloLGS Fonts
MesloLGS NF Regular.ttf
MesloLGS NF Bold.ttf
MesloLGS NF Italic.ttf
MesloLGS NF Bold Italic.ttf
Then install powerlevel10k itself
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
In ~/.zshrc
set the ZSH theme to use:
ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.
You will probably at least configure these two ZSH plugins:
zsh-syntax-highlighting - Fish shell like syntax highlighting for Zsh. This is what makes my aliases/commands green above. If it's green then it's installed!
zsh-autosuggestions - Fish-like autosuggestions for zsh. Will show a preview of the last matching command while typing. Press right to use
In ~/.zshrc
set the ZSH plugins to use:
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
)
Restart your terminal with Zsh
Now you can run
p10k configure
If you have issue with fonts, check MesloLGS font is selected.
Open iTerm2 → Preferences → Profiles → Text and set Font to MesloLGS NF
.
Finally, if you want to include your existing bash aliases and functions:
In ~/.zshrc
source your bash_profile just before the export ZSH
source ~/.bash_profile
Add the Toolbar
Open your iterm2 > Profile > Session > Status bar enabled
Finished!
I hope this small tutorial will help you to improve your setup. It is obviously not complete but easy enough to move on.
Top comments (12)
First time I saw the toolbar feature in a CLI, sweet. Time to toy around with that one.
I can recommend these two tools to improve the Git experience on the CLI:
git diff
git log
For install this two plugins :
git clone github.com/zsh-users/zsh-autosugge... ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone github.com/zsh-users/zsh-syntax-hi... ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
Is there something like this for windows terminal/powershell?
ohmyposh. scott hanselman has some oretty good articles and videos on setting this up
Thanks. I will check it out
Hi Sangy,
Yes, there is also ohmyposh. Take a look here for Windows 😊:
dev.to/alagrede/terminal-setup-mak...
Thanks. I will check it out
I have been using the same setup for last 5 years now. I use the font firacode though.
Thanks for this, I found it helpful
it has work with mac chip m1?
Hi @devphu, yes of course.
Check out my post for more awesome features 🦄