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


nano

A small and friendly editor. As of macOS 12.3 nano was replaced with a symlink to pico. 😠

brew install nano

https://www.nano-editor.org/


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


Vim Plugins

vim-plug: Minimalist Vim Plugin Manager.

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
~/.vimrc
call plug#begin()
" The default plugin directory will be as follows:
"   - Vim (Linux/macOS): '~/.vim/plugged'
"   - Vim (Windows): '~/vimfiles/plugged'
"   - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged'
" You can specify a custom plugin directory by passing it as the argument
"   - e.g. `call plug#begin('~/.vim/plugged')`
"   - Avoid using standard Vim directory names like 'plugin'

" Make sure you use single quotes
Plug 'tpope/vim-sensible'

" Uncomment to enable catppuccin theme
" Plug 'catppuccin/vim', { 'as': 'catppuccin' }

" Initialize plugin system
" - Automatically executes `filetype plugin indent on` and `syntax enable`.
call plug#end()
" You can revert the settings after the call like so:
"   filetype indent off   " Disable file-type-specific indentation
"   syntax off            " Disable syntax highlighting

set termguicolors
colorscheme catppuccin_mocha

Afterwards you'll need to run :PlugInstall from within vim.

https://github.com/junegunn/vim-plug


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

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 -

If you chose to install pyenv, I suggest enabling this option so that Poetry will default to the active/global version of Python:

poetry config virtualenvs.prefer-active-python true

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/


hadolint

Dockerfile linter, validate inline bash, written in Haskell.

brew install hadolint

https://github.com/hadolint/hadolint


dive

A tool for exploring each layer in a docker image.

brew install dive

https://github.com/wagoodman/dive


Kubernetes Tools

kubectl

Basic Kubernetes command line tools, such as kubectl.

brew install kubernetes-cli

https://kubernetes.io/


krew

Krew is the plugin manager for kubectl command-line tool.

Follow the install instructions: https://krew.sigs.k8s.io/docs/user-guide/setup/install/

The list of available plugins can be found here: https://krew.sigs.k8s.io/plugins/

Plugins

get-all: Like kubectl get all but really everything

kubectl krew install get-all

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/

Fonts

brew tap homebrew/cask-fonts
brew install font-hack-nerd-font font-meslo-lg-nerd-font font-ubuntu-mono-nerd-font

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 Nerd Font Mono"