Skip to content

Instantly share code, notes, and snippets.

@wallw-teal
Last active September 13, 2022 16:59
Show Gist options
  • Save wallw-teal/9eaed41e3ee6ea7dea1092363f39935c to your computer and use it in GitHub Desktop.
Save wallw-teal/9eaed41e3ee6ea7dea1092363f39935c to your computer and use it in GitHub Desktop.
MacOS Setup

Installation

Note that most of the Settings/Preferences-specific items are just that: preference. Feel free to play around and find something you like.

  • Get rid of just about everything in the dock (if you need something less often, use cmd+space and type the name of the thing)
  • Open Safari, copy instructions for installing brew
  • Open Terminal (via cmd+space), paste
    • While that is doing its thing, poke around in settings:
      • Dark mode
      • Quicker screen saver delay
      • Smaller dock and hide/display dock automatically
      • Add Bluetooth to top bar all the time
      • Keyboard
        • quicker repeat
        • shorter delay
        • Go to the Text tab and DISABLE EVERYTHING because it massively sucks when we talk about code all the time
    • Add a workspace: ctrl + up arrow, then click the plus button in the top right. Navigate back and forth with ctrl+left/right. When using the trackpad, three finger swipe left/right will navigate workspaces
  • Follow instructions at the end for adding /opt/homebrew/bin to the path and to .zprofile
  • When in doubt, use brew to install (gives you greater control over updates and versions) rather than the app store (plus this gives you the ability to operate entirely without an Apple ID if you like):

If you're gonna keep zsh, now is the time to install oh-my-zsh

Brew Note: --cask is typical for gui apps, since brew by default only installs cli tools. The "cask" plugin works with guis.

Firefox

brew install --cask firefox
  • cmd+space, "firefox", enter
  • Yes to "keep in dock", "default browser", "system theme"
  • Add uBlock Origin, Dark Reader, Bitwarden, and Multi Account Container plugins
  • Disable all password saving, adjust suggestions, and use Duck Duck Go in settings
  • Set default font to something which is actually designed to be read on a screen like Helvetica (remember you're on a Mac) or something

Chrome

brew install --cask google-chrome

I tend to not touch as many Chrome settings outside of making it shut up about syncing and password saving and whatnot, simply because I use that and Safari as my more typical "This is what the users will see" dev browser.

If it is your daily driver, see the note from Firefox about ensuring it picks a sane default font.

iTerm

brew install --cask iterm2

cmd+space and pick iterm.app

Powerline Fonts

This is optional, but in the event you are using something which makes use of Powerline fonts (Airline for vim/neovim, for instance), you should install them.

git clone https://github.com/powerline/fonts
cd fonts
./install.sh
cd -
rm -rf fonts
  • Set fonts in iterm via Prefs > Profiles > Text to anything with "for Powerline" that you like
  • Silence bell and flash visual bell in Prefs > Profiles > Terminal

Color Schemes

Note: If you opted to use zsh with oh-my-zsh, then you can use themes through that. Otherwise...

  • Run Gogh to set your terminal colors: https://github.com/Mayccoll/Gogh
  • Pick color scheme(s)
  • Those now show in Prefs > Profiles > Colors > Presets so go pick one

SSH

  • Configure ssh (copy in existing keys or just make one)
# ~/.ssh/config
Host *
   UseKeychain yes
   AddKeysToAgent yes
   IdentityFile ~/.ssh/id_rsa

If you have an existing key:

ssh-add --apple-use-keychain ~/.ssh/[your-private-key]

GPG

I prefer signing my git commits. It is fine if you don't want to. Consider this optional.

git config --global gpg.program $(which gpg)
git config --global commit.gpgsign true
git config --global user.signingkey <key id>

Ensure GitHub/GitLab/etc. knows about both your SSH and GPG keys.

Python

Install python 3 (because Apple is slacking on that with the system-installed python)

brew install python

Installs as python3, pip3, etc. feel free to add aliases or symlinks

Docker

Docker on mac includes some gui pieces so use --cask

brew install --cask docker
  • cmd+space, "docker", enter
  • Follow getting started instructions to verify you can run a container
  • Add docker and docker-compose to the oh-my-zsh plugins in ~/.zshrc

Comms

  • brew install --cask zoom
  • brew install --cask slack
  • brew install --cask discord
  • etc.

GNU Utils

If you're writing scripts targeting Linux (in CI or just for compatibility), you need the GNU utilities.

brew install coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt grep

Then add to ~/.zshrc:

# use gnu utils
for i in /opt/homebrew/opt/*/libexec/gnubin; do
    export PATH="$i:$PATH"
done

Make Home/End behave like every other OS

Hipster nonsense.

~/Library/KeyBindings/DefaultKeyBinding.dict

{
  "\UF729"  = moveToBeginningOfParagraph:; // home
  "\UF72B"  = moveToEndOfParagraph:; // end
  "$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
  "$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
  "^\UF729" = moveToBeginningOfDocument:; // ctrl-home
  "^\UF72B" = moveToEndOfDocument:; // ctrl-end
  "^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl-shift-home
  "^$\UF72B" = moveToEndOfDocumentAndModifySelection:; // ctrl-shift-end
}

Log out/in or restart to take effect. Note that many third party apps like Slack do not respect this file, but most should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment