Configure your macOS command-line for a smoother development experience

Published on - Updated on

The default Terminal experience on macOS is not bad, but there are several things you can do to make working with the command-line a nicer experience. Whether it's working with Git, writing Bash scripts, working with the AWS CLI, debugging code, ..., developers spent a lot of time working within a command-line environment. Due to the amount of time that we use the command-line, small optimisations can make a huge difference in your productivity.

Step 1: Install a custom font

Prompt example

We want to install a font that is both easy on the eyes and that is rich enough, so that it allows us to create a nice command-line prompt later on that includes some status information using icons (as in the image above). For this purpose I install the Powerline fonts. The below script clones the repository, installs the fonts and then removes the repository again.

# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts

Once the fonts are installed we can choose one of the fonts to use. I tend to use Meslo LG L DZ with 16pt as the size, for my command-line configuration.

See Step 2 in case you want to download the font and color configuration I use on a day-to-day basis.

Step 2: Configure a color scheme

The default command-line colors are not easy on the eyes, so I tend to use a custom color scheme. You can import one or all of the below files to customize colors in the tools you use.

Note: that the files will customize your font to Meslo as well.

Step 3: Install Oh My ZSH

TO DO