Upgrade Your Mac Terminal: A Quick Guide to Make It Beautiful and Functional
Want to take control of your Mac terminal? Here's a quick guide with everything you need to get started.
So you want one of those fancy macOS terminal setups, but don't know where to start. Let me help you out.
Prerequisites
? Have a Mac: This guide is for macOS but perhaps a Window's guide is coming soon.
? Install Brew: Run the command below if you don't have it installed.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Color scheme
First things first. We need that pop of color. We're nonjudgemental so you can pick your favorite terminal color scheme. Maybe switch it up every day. Select and download one of the color schemes aka .terminal
files available from the repo below.
Open the .terminal
file in Terminal and your prompt should be colored. To select this scheme, go to Preferences and set the selected one to your Default.
Fonts
Nerd fonts has a great selection of fonts to add to your terminal. They integrate icons into a font so these are essential to many cool command line tools. Select your favorite one from here and install it.
After it's installed, go to your Terminal preferences and set the font on your existing theme. I highly recommend not picking the monospaced font because the icons show up very small since they must occupy the same space as a letter.
Prezto
The new macOS terminal defaults to use zsh instead of bash. There are different ways to customize this with theming and tools. Recently, I started using prezto. Prezto is super convenient and gives built in tools like git integration and auto complete and doesn't really require the same upfront configuration as other tools like Oh My Zsh.
brew install prezto
Once you have prezto installed, theming prezto is just a couple simple commands.
List themes
prompt -l
Preview theme
prompt -p <name>
Install theme
Go to ~/.zprezto/romcom/.zpreztorc
and add the name this file. I chose the theme pure
specifically because it keeps the terminal very clean while still showing the git integration. Find your favorite though.
Viewing File Structure
tree
This package adds the tree
command to allow you to see a beautiful tree structure of all your files.
brew install tree
Then you can just run tree
to sift through your repositories.
list
ls
is great but we can do better. exa
is a great replacement.
brew install exa
Note: If you followed the prezto steps, you can create a handy alias instead of writing exa. Add alias "list=exa --icons"
to your ~/.zprezto/romcom/.zshrc
Fin
You're done. Enjoy your beautiful terminal. Send me a tweet @keithrfung if you love it.