macOS Development Environment Setup

11/01/2022

Setting up a new Mac can be a detailed process. This guide provides a streamlined checklist for configuring a clean, efficient, and developer-friendly macOS environment.

System Preferences

A few initial tweaks to System Preferences can significantly improve the user experience.

  • Trackpad:
    • Set tracking speed to a higher sensitivity (e.g., MAX - 1).
    • Enable "Tap to click" and "Three-finger drag".
    • Enable "Look up & data detectors" with a three-finger tap.
  • Date & Time:
    • Set to your correct region.
    • Use 24-hour time format and Celsius for temperature.
  • Privacy & Security:
    • Consider changing your computer's name to something generic to avoid broadcasting your personal name on networks.
  • Keyboard:
    • Disable "Smart quotes" to avoid issues when writing code.

Terminal & Shell

A powerful terminal setup is essential for any developer. This setup uses zsh with Oh My Zsh.

  1. Install Fonts: For better readability, install a developer-friendly font like SF Mono.

  2. Install Oh My Zsh: A framework for managing your zsh configuration.

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    
  3. Configure ~/.zshrc:

    • Plugins: Enable useful plugins to enhance your shell.

      plugins=(
          git
          brew
          macos
          zsh-syntax-highlighting
          zsh-autosuggestions
          timer
      )
      
  4. Recommended Tools:

    • eza: A modern replacement for ls, built on exa.
    • bat: A cat clone with syntax highlighting.
    • fzf: A command-line fuzzy finder.
    • ripgrep: A fast, recursive search tool.
    • zoxide: A smarter cd command.
    • fnm: A fast Node.js version manager.
    • Explore more at modern-unix

Development Tools

  1. Install Homebrew: The missing package manager for macOS.

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Configure Git: Set your identity for commits.

    # Set your commit email address
    git config --global user.name "Your Name"
    git config --global user.email "your-email@example.com"
    

    Refer to GitHub's documentation for managing commit email addresses.

  3. Configure SSH: Use a ~/.ssh/config file to manage multiple SSH keys and hosts.

    Host github.com
        HostName github.com
        User git
        IdentityFile ~/.ssh/id_rsa_github
    
    Host work-server
        HostName server.work.com
        User admin
        IdentityFile ~/.ssh/id_rsa_work
    

Essential Applications

Install these applications via Homebrew Cask or direct download for a productive workflow.