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!
Recommended Software¶
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
mtr (traceroute)¶
TUI traceroute utility.
brew install mtr
https://github.com/traviscross/mtr
Nmap¶
Network scanner.
brew install nmap
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
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
Developer Tools¶
PostgreSQL¶
Database software.
brew install postgresql
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 -
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
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
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
kubectx¶
Switch between Kubernetes contexts faster and easier.
brew install kubectx
https://github.com/ahmetb/kubectx
Helm¶
Kubernetes package manager.
brew install helm
k9s¶
TUI for Kubernetes.
brew install derailed/k9s/k9s
ZSH Setup¶
Features¶
Step-By-Step Instructions¶
-
Install Oh My ZSH:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
-
Restart iTerm
-
Install powerlevel10k:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
-
Edit
~/.zshrc
, setZSH_THEME="powerlevel10k/powerlevel10k"
- Restart iTerm
- Follow setup directions from p10k
-
Install terminal-notifier, required for the
bgnotify
Oh My ZSH plugin:brew install terminal-notifier
-
Install zsh-autosuggestions:
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
-
Install autoupdate:
git clone https://github.com/TamCore/autoupdate-oh-my-zsh-plugins $ZSH_CUSTOM/plugins/autoupdate
-
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
-
Edit
~/.zshrc
-
Add the following lines to the end of the file:
ZSH_AUTOSUGGEST_STRATEGY=(history completion) ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20 bgnotify_threshold=30
-
Edit the
plugins
setting:plugins=( autoupdate aws bgnotify fast-syntax-highlighting macos terraform safe-paste zsh-autosuggestions )
-
-
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"