macOS My Way, Configuring the Terminal

Here I am, setting up a Macbook for the 999th time this year. For better or worst, I like things a certain way. This series explains how to set up a macOS development environment my way; the cool way.

During my time at tech, I have had the opportunity to work with some amazing people. Many of which had the best setup I have ever seen. I also had the opportunity to build, or image, hundreds of computers as a support engineer.

Since the beginning of time, I've always looked for ways to automate my way out of menial tasks. Setting up macOS my way is one of them. I strongly believe a good UI experience in combination with the right tools can make a development setup MUCH more efficient.

However, as time passes, ways of doing things change. For that reason, I'm going to outline high-level instructions with one-liners that works as of the time of this writing. I'm not sharing my script because it is not future proof and I want this to work even when I'm 60. So here is the plan:

Setting up the terminal

  1. Open the native macOS terminal:

  2. Install Homebrew, and follow the prompts:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. Add Homebrew to your path (the end of the previous command will tell you exactly what to do):

    (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/matheo/.zprofile;
    eval "$(/opt/homebrew/bin/brew shellenv)"
  4. Install iTerm2, we are going to brew it:

    brew install --cask iterm2
  5. Instal OhMyZsh:

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  6. Install PowerLevel10k:

    brew install romkatv/powerlevel10k/powerlevel10k
    echo "source $(brew --prefix)/opt/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc
  7. Install syntax highlight:

    brew install zsh-syntax-highlighting
  8. Add misc configs to zshrc:

  9. Open iTerm, and configure your preferences:

    exec zsh

Few caveats:

  • You need to have the right fonts installed.

  • You might want to change the theme by going to iTerm2 > Settings > Profiles > Clone Default > Color Presets > Pick whatever > Set as Default.

  • You might want to set natural text edit (so you can use better shortcuts) by going to iTerm2 > Settings > Profiles > Keys > Key Mappings > Presets > Natural Text Edit > Keep.

  • You can force quit the classic "Terminal" and pin iTerm2 to the dock.

That is it! In the next section, I'm going to outline how to integrate these terminal configurations into my favorite IDE.

Have fun, stay safe, and see you around!

Last updated