Skip to content

macOS Setup

Originally I wrote this guide to remind myself how to setup my M1 Macbook the way I like it. A few friends and coworkers expressed interest in my setup, so I cleaned up the notes (a bit) and created this guide. You don't need to follow this guide completely, I encourage you to pick-and-choose the pieces you want to use and to tweak things to fit your needs. I also love to see how other people have setup their systems, so please share your configs!

Download and install these following the instructions on their websites:

Command Line Tools

Btop++

TUI resource monitoring. C++ version and continuation of bashtop and bpytop.

brew install btop

https://github.com/aristocratos/btop


Mosh

Better SSH for high latency or unreliable connections.

brew install mosh

https://mosh.org/


mtr (traceroute)

TUI traceroute utility.

brew install mtr

https://github.com/traviscross/mtr


Nmap

Network scanner.

brew install nmap

https://nmap.org/


jq

Command line JSON parser.

brew install jq

https://stedolan.github.io/jq/


fq

Like JQ but for binary formats.

brew install wader/tap/fq

https://github.com/wader/fq


bat

A cat(1) clone with syntax highlighting and Git integration.

brew install bat
brew install eth-p/software/bat-extras

While it's optional, I recommend installing the bat-extras, it's a collection of bash scripts that integrate bat with various command line tools.

To easily format help output from a command, I put the following alias and function in my ~/.zshrc file:

# ~/.zshrc
alias bathelp='bat --plain --language=help'
help() {
    "$@" --help 2>&1 | bathelp
}

https://github.com/sharkdp/bat


fd

A simple, fast and user-friendly alternative to find

brew install fd

https://github.com/sharkdp/fd


Developer Tools

PostgreSQL

Database software.

brew install postgresql

https://www.postgresql.org/


Lefthook

Git hooks manager, useful for development.

brew install lefthook

https://github.com/evilmartians/lefthook


Poetry

A Python dependency manager and packaging tool.

curl -sSL https://install.python-poetry.org | python3 -

https://python-poetry.org/


git-delta

A syntax-highlighting pager for git, diff, and grep output.

brew install git-delta

Update your ~/.gitconfig file:

# ~/.gitconfig
[core]
    pager = delta

[interactive]
    diffFilter = delta --color-only
[add.interactive]
    useBuiltin = false # required for git 2.37.0

[delta]
    navigate = true    # use n and N to move between diff sections
    light = false      # set to true if you're in a terminal w/ a light background color (e.g. the default macOS terminal)

[merge]
    conflictstyle = diff3

[diff]
    colorMoved = default

https://github.com/dandavison/delta


Prettier

Code formatter for JavaScript, CSS, JSON, GraphQL, Markdown, YAML.

brew install prettier

https://prettier.io/

Version Managers

There are helpful tools to install and run multiple versions of various programming languages.

Python (pyenv)

brew install pyenv

https://github.com/pyenv/pyenv


NodeJS (nvm)

Once the install completes, be sure to follow the instructions provided and add the required lines to your ~/.zhsrc file.

brew install nvm

https://github.com/nvm-sh/nvm


Terraform (tfenv)

brew install tfenv

https://github.com/tfutils/tfenv

Kubernetes Tools

kubectl

Basic Kubernetes command line tools, such as kubectl.

brew install kubernetes-cli

https://kubernetes.io/


kubectx

Switch between Kubernetes contexts faster and easier.

brew install kubectx

https://github.com/ahmetb/kubectx


Helm

Kubernetes package manager.

brew install helm

https://helm.sh/


k9s

TUI for Kubernetes.

brew install derailed/k9s/k9s

https://k9scli.io/

ZSH Setup

Features

https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-styles-high-contrast.png

Step-By-Step Instructions

  1. Install Oh My ZSH:

    sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    
  2. Restart iTerm

  3. Install powerlevel10k:

    git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
    
  4. Edit ~/.zshrc, set ZSH_THEME="powerlevel10k/powerlevel10k"

  5. Restart iTerm
  6. Follow setup directions from p10k
  7. Install terminal-notifier, required for the bgnotify Oh My ZSH plugin:

    brew install terminal-notifier
    
  8. Install zsh-autosuggestions:

    git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
    
  9. Install autoupdate:

    git clone https://github.com/TamCore/autoupdate-oh-my-zsh-plugins $ZSH_CUSTOM/plugins/autoupdate
    
  10. Install fast-syntax-highlighting:

    git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git \
     ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
    
  11. Edit ~/.zshrc

    1. Add the following lines to the end of the file:

      ZSH_AUTOSUGGEST_STRATEGY=(history completion)
      ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
      bgnotify_threshold=30
      
    2. Edit the plugins setting:

      plugins=(
          autoupdate
          aws
          bgnotify
          fast-syntax-highlighting
          macos
          terraform
          safe-paste
          zsh-autosuggestions
      )
      
  12. Install fzf for better history searching (ctrl-r):

    brew install fzf
    
    # To install useful key bindings and fuzzy completion:
    $(brew --prefix)/opt/fzf/install
    

Optional: VS Code Settings

VS Code users will need to add the following to their settings.json:

"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.fontFamily": "MesloLGS NF"