Gatlin.io Icon
Image of Austin Gatlin's face
March 3, 2022 (last updated March 18, 2022)

Machine Setup: MacOS

Introduction

This is a link-first guide which I define and defend in the linked blog post. The goal of this guide is a sequential list of links to help facilitate setup. An anti-goal of this guide is a setup script or example repo.

Brew

https://brew.sh/

https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# ~/.zshrc

if type brew &>/dev/null
then
  FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"

  autoload -Uz compinit
  compinit
fi

Zsh

# ~/.zshrc

alias ..='cd ..'
alias g='git'
alias imps='iex -S mix phx.server'
alias l='ls -G'
alias ls='ls -G'
alias ll='ls -al'
alias nr='npm run'
alias v='vim'

Git

https://git-scm.com/

git config --global user.name [name]
git config --global user.email [email]

https://gatlin.io/notes/git#aliases

git config --global alias.ap "add -p"
git config --global alias.br "branch"
git config --global alias.bra "branch --all"
git config --global alias.co "checkout"
git config --global alias.c "commit"
git config --global alias.ca "commit --amend"
git config --global alias.cane "commit --amend --no-edit"
git config --global alias.cm "commit --message"
git config --global alias.lol "log --oneline"
git config --global alias.lolg "log --oneline --graph"
git config --global alias.st "status"

asdf

https://asdf-vm.com/

https://asdf-vm.com/guide/getting-started.html#_3-install-asdf

brew install asdf
# ~/.zshrc

. /usr/local/opt/asdf/libexec/asdf.sh
asdf plugin add [erlang elixir nodejs]

There's substantial overlap between what asdf and brew can do. In the past I've leaned heavily towards asdf, but have lately been swinging back towards using brew for tools and asdf for languages. One edge case at the moment is postgres. Not sure how I want it installed.

Hyper

https://hyper.is/

https://github.com/vercel/hyper#macos

brew install --cask hyper

# Once inside the hyper terminal:
hyper i hyper-solarized-light

You can change font size and other configuration parameters in ~/.hyper.js, though it appears likely to change in the future.

Starship

https://github.com/Homebrew/homebrew-cask-fonts

https://www.programmingfonts.org/#firacode

brew tap homebrew/cask-fonts
brew install font-fira-code-nerd-font

In iTerm2, Preferences > Profiles > Text > Font, "FireCode Nerd Font Mono" should "just show up", and when selected, the icons should "just work".

In VSCode, User Settings > Editor: Font Family, can be prepended with "FiraCode Nerd Font Mono, ..." and it should "just work". You should see icons in the integrated terminal, etc. Terminal inherits from this, but you can also set the terminal font independently in "Terminal > Integrated: Font Family"

https://hyper.is/#config-location

In Hyper, you edit ~/.hyper.js but that seems to be changing soon (see config link above). But, in fontFamily you can prepend with '"FiraCode Nerd Font Mono", ...' and it should "just work".

https://starship.rs/

https://starship.rs/config/#prompt

brew install starship
# ~/.zshrc

eval "$(starship init zsh)"

Fig

https://fig.io/

https://github.com/withfig/autocomplete#%EF%B8%8F-installation

brew install fig

Docker

https://docs.docker.com/desktop/mac/install/

https://github.com/jesseduffield/lazydocker

brew install --cask docker
brew install lazydocker

VSCode

https://code.visualstudio.com/

https://code.visualstudio.com/docs/editor/settings-sync

https://code.visualstudio.com/docs/editor/vscode-web

brew install visual-studio-code

As long as you have settings-sync enabled, everything "just works".

Vim

I keep my ~/.vim/ folder source controlled at aegatlin/dotvim. For more information, see my note on the vim builtin package manager and my vim cheatsheet. Also, here is my old init.lua config for neovim.

More comprehensive cheatsheets:

https://devhints.io/vim

https://vim.rtorr.com/

Next Steps

Here are just a few more commands I will definitely run. There is way more setup to do from here, but this is a good starting point, and a good place to end this guide. Thanks for reading :D

brew install superfly/tap/flyctl
brew install gh firefox google-chrome
asdf plugin add direnv
asdf install direnv latest
asdf global direnv [version]