The Ultimate MacBook Pro M1 Developer Setup Guide

ArjanCodes////4 min read

Overview

Setting up a new development machine correctly saves hours of frustration later. This guide explores the transition to a MacBook Pro with the M1 Max chip, focusing on transforming a stock macOS installation into a high-performance Python development environment. By streamlining the terminal, managing Python versions effectively, and optimizing VS Code, you create a workflow that gets out of your way and lets you focus on logic.

Prerequisites

To follow this guide, you should have basic familiarity with the command line and the Python programming language. While this tutorial focuses on the Apple Silicon architecture, many of the VS Code configurations apply globally to Windows and Linux environments as well.

Key Libraries & Tools

  • Homebrew: The essential package manager for macOS.
  • iTerm2: A powerful terminal replacement for the default Mac console.
  • Oh My Zsh: A framework for managing Zsh configurations and themes.
  • Pyenv: A tool to manage and switch between multiple Python versions.
  • Docker: Containerization platform for deploying cloud-native applications.
  • Rectangle: An open-source window management tool for macOS.
The Ultimate MacBook Pro M1 Developer Setup Guide
How To Setup A MacBook Pro M1 For Software Development

Code Walkthrough

1. Initializing Homebrew and Shell

First, install Homebrew to handle system-level dependencies. After the installation script finishes, you must add the binary to your path to ensure the brew command is recognized.

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

# Add to path (replace <user> with your username)
echo 'eval "(/opt/homebrew/bin/brew shellenv)"' >> /Users/<user>/.zprofile
eval "(/opt/homebrew/bin/brew shellenv)"

2. Managing Python Environments

Avoid using the system-provided Python. Instead, use Pyenv to install specific versions. This prevents version conflicts when working on different projects.

# Install pyenv via brew
brew install pyenv

# Install a specific Python version
pyenv install 3.10.1

# Set the global version
pyenv global 3.10.1

3. VS Code Automation

In VS Code, automate your styling using the Black formatter and the Vim plugin for faster navigation. Configure your settings.json to handle these tasks on save.

{
    "python.formatting.provider": "black",
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
        "source.organizeImports": true
    },
    "vim.smartRelativeLine": true
}

Syntax Notes

When configuring macOS, the shell defaults to Zsh. Configuration changes belong in .zshrc or .zprofile. For VS Code, the use of "vim.smartRelativeLine": true is a notable convention for Vim users; it displays the current line number but shows relative distances for all other lines, making vertical jumps significantly faster.

Practical Examples

Using Rectangle allows you to snap windows using keyboard shortcuts (e.g., Command + Option + Left Arrow). This mimics the window-snapping features found in Windows but adds more granular control for developers multitasking between a browser, terminal, and editor. For Python developers, Pyenv is particularly useful when you need to maintain a legacy project on Python 3.7 while starting new work on 3.11.

Tips & Gotchas

  • Caps Lock Swap: Map Caps Lock to Escape in System Preferences. It is a game-changer for Vim users who need to exit Insert Mode constantly.
  • Apple Silicon Docker: Always ensure you download the "Apple Chip" version of Docker. The Intel version will run via Rosetta 2 but suffers from significant performance degradation.
  • Path Issues: If brew commands fail after installation, double-check that you executed the path configuration commands in your shell profile.
Topic DensityMention share of the most discussed topics · 26 mentions across 14 distinct topics
VS Code
15%· products
Pyenv
12%· products
Vim
12%· products
Docker
8%· products
Homebrew
8%· products
Other topics
46%
End of Article
Source video
The Ultimate MacBook Pro M1 Developer Setup Guide

How To Setup A MacBook Pro M1 For Software Development

Watch

ArjanCodes // 21:23

On this channel, I post videos about programming and software design to help you take your coding skills to the next level. I'm an entrepreneur and a university lecturer in computer science, with more than 20 years of experience in software development and design. If you're a software developer and you want to improve your development skills, and learn more about programming in general, make sure to subscribe for helpful videos. I post a video here every Friday. If you have any suggestion for a topic you'd like me to cover, just leave a comment on any of my videos and I'll take it under consideration. Thanks for watching!

What they talk about
AI and Agentic Coding News
Who and what they mention most
Python
27.3%3
Python
18.2%2
Python
18.2%2
4 min read0%
4 min read