The Opinionated Guide to Setting up a New Macbook Pro (for Software Engineers)

After recently getting a new Macbook Pro, I decided to start from a clean slate, rather than simply use a Time Machine backup to restore. Why? Well, I had almost 4 years of cruft built up on my old machine, and I wanted to use this as an opportunity to re-evaluate the programs and settings that I had accumulated during that time.

Note that this is not meant to be an all-encompassing guide, but rather something to surface programs and tools that you maybe haven’t come across yet.

A better terminal & shell

iTerm2

iterm2.png

A much better, more fully featured terminal than the one that ships default with macOS.

zsh & oh-my-zsh

oh-my-zsh.png

First, make sure that you already have zsh installed. You probably do, but double check:

Check if zsh is installed
1
zsh --version

OK great, you have it. So what’s zsh you ask? It’s a shell for Unix-based systems, and an alternative to bash (the default shell on macOS systems), fish, and others. A few nice features native to zsh are:

  • Really good autocompletion
  • Autocorrect
  • Shared history between shell tabs
  • And most of all, compatibility with oh-my-zsh

oh-my-zsh is self-described as, “…an open source, community-driven framework for managing your zsh configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes…”

Basically, it makes your life as an engineer a lot better.

Get to it:

Install oh-my-zsh
1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Homebrew

oh-my-zsh.png

Homebrew’s a great package manager for macOS. It’ll allow you to install many other useful scripts, packages, & programs.

Install Homebrew
1
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Homebrew Cask

Cask is an extension of Homebrew and will allow you to install macOS apps and other large binaries (things not supported by Homebrew out of the box).

Install Cask
1
brew tap caskroom/cask

Once you’ve got those four things installed, you can install a bunch of useful things pretty rapidly.

iTerm2 / oh-my-zsh necessities

diff-so-fancy

diff-so-fancy.png

This makes your git diffs in the terminal much more readable.

1
brew install diff-so-fancy

Then customize your diff-so-fancy colors like so:

1
2
3
4
git config --global color.diff-highlight.oldNormal "red bold"
git config --global color.diff-highlight.oldHighlight "red bold 52"
git config --global color.diff-highlight.newNormal "green bold"
git config --global color.diff-highlight.newHighlight "green bold 22"

git-extras

Tons of little git commands that make your life better, including:

1
2
3
4
5
6
git create-branch
git delete-branch
git pull-request
git graft
git squash
git undo

And many, many more.

Install git-extras
1
brew install git-extras

httpie

httpie.png

A command line http client that’s a lot more fun to use than cURL.

Install httpie
1
brew install httpie

ag, The Silver Searcher

Really, really fast searching. It’s like ack but orders of magnitude faster.

Install ag
1
brew install the_silver_searcher

zsh-autosuggestions

Get fish-like autosuggestions in your zsh shell

Install zsh-completions
1
brew install zsh-completions

Caffeine

Prevents your display from dimming and your laptop from going to sleep during idle periods.

1
brew cask install caffeine

Atom

atom.png

A simple, yet highly configurable text editor developed by Github. Much better than SublimeText.

1
brew cask install atom

BetterTouchTool

bettertouchtool.png

Customize any keys or mouse gestures & a lot more.

1
brew cask install bettertouchtool

Slate

The hacker’s window manager. Bind keyboard shortcuts to specific window layouts.

1
brew cask install slate

Moom

moom.png

The layperson’s window manager. Drag & drop windows to have them resize or “stick” somewhere.

1
brew cask install moom

Alfred 3

Excellent macOS launcher that’s highly configurable. One of its key features is a clipboard history tool.

1
brew cask install alfred

Once Alfred is installed, take a look at some of these plugins.

F.lux

flux.png

Changes the color temperature of your display based on the time of day. Extremely useful for filtering out harsh blue light when working late at night.

1
brew cask install flux

Bartender

bartender.png

Declutter your toolbar.

1
brew cask install bartender

iStat menus

istat-menus.jpg

Stats about your machine right in the toolbar.

pgcli

A really nice cli for Postgres that has syntax highlighting and auto-completion.

1
brew install pgcli

Privacy & Security

FileVault

filevault.png

Encrypt your hard drive in the event that your laptop is lost or stolen.

hosts

Block ads and other junk at the network level.

1
2
git clone https://github.com/StevenBlack/hosts.git
cd hosts && python updateHostsFile.py

GnuPG

Open-source implementation of the OpenPGP standard.

1
brew install gnupg

Keybase

keybase.jpg

Crypto made a lot easier. Sign, verify, encrypt, generate messages, sign code, move keys around, and more.

Little Snitch

little-snitch.png

Monitor your outgoing network connections.

1
brew cask install little-snitch

PIA

VPN service for when you need to join an unsecured network.

lastpass-cli

A cli for working with LastPass. Use this in conjunction with the LastPass Alfred workflow.

1
brew install lastpass-cli

DuckDuckGo

duckduckgo.png

A search engine that doesn’t track you. Make it your default search engine in Chrome’s omnibox.

Configuring macOS

Make key repeat fast

key-repeat.png

Makes it faster to ‘scroll’ when using your keyboard arrow keys. Set ‘Key Repeat’ to ‘Fast’ and ‘Delay Until Repeat’ to ‘Short’.

Disable caps lock

This is a pretty useless key. You can also bind it to something more useful later (like Ctrl).

capslock.png

Disable Siri

Siri is unfortunately just not good.

siri.png

Remove Siri icon from the touchbar

touchbar.png

Configuring VIM

vim-plug

vim-plug is a really nice vim plugin manager.

vim-plug.gif
1
2
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

My .vimrc file (a continuing work-in-progress):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'
Plug 'tpope/vim-fugitive'
Plug 'scrooloose/syntastic'
Plug 'tpope/vim-surround'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'altercation/vim-colors-solarized'
Plug 'bling/vim-airline'
Plug 'airblade/vim-gitgutter'
Plug 'pangloss/vim-javascript'
Plug 'ervandew/supertab'
Plug 'vim-airline/vim-airline'
Plug 'rking/ag.vim'
Plug 'elzr/vim-json'
Plug 'tpope/vim-sensible'
Plug 'derekwyatt/vim-scala'
call plug#end()
set number " show line numbers
set cursorline " highlight current line

Backups

Backblaze

Cloud backups made really easy. One of those things you never hope you actually need, but is a lifesaver when you do.

Chrome Extensions

https everywhere

json-formatter

ublock origin

vimium