This repository bootstraps a new Mac development environment with Homebrew packages, shell configuration, Git configuration, Ghostty configuration, Emacs configuration, and a small set of macOS defaults.
Install Xcode command line tools first:
xcode-select --installClone and run the bootstrap:
git clone https://github.com/Pancf/dotfiles.git ~/opensource/dotfiles
cd ~/opensource/dotfiles
./bootstrap.shFor a preview without changing files:
./bootstrap.sh --dry-run./bootstrap.sh --helpSupported flags:
--dry-run: show actions without changing files.--skip-brew: skip Homebrew andBrewfileinstallation.--skip-shell: skip Oh My Zsh and shell plugin installation.--skip-git: skip Git config symlink.--skip-ghostty: skip Ghostty config symlink.--skip-macos: skip macOS defaults.--skip-emacs: skip Emacs configuration.--skip-nvm: skip nvm installation.
- Homebrew installation when missing.
brew bundlefromBrewfile.- Oh My Zsh installation.
- Powerlevel10k installation.
zsh-syntax-highlightingandzsh-autosuggestionsinstallation.- nvm installation through the upstream installer, not Homebrew.
- Symlinks for:
~/.zshenv->shell/zshenv~/.zshrc->shell/zshrc~/.gitconfig->git/gitconfig~/.config/ghostty/config->ghostty/config
- Spacemacs and personal Emacs configuration.
- Reliable macOS defaults such as 24-hour time, Dock position, key repeat, tap-to-click, secondary click, and showing file extensions.
Private, machine-specific, or work-specific settings should stay out of tracked files.
Use these local files:
~/.zshrc.local~/.zshenv.local~/.gitconfig.local
Examples are provided in:
shell/zshrc.local.exampleshell/zshenv.local.examplegit/gitconfig.local.example
Do not commit company credentials, proxy assumptions, internal paths, telemetry, or machine-specific Git identity.
Edit Brewfile, then run:
brew bundle --file BrewfileCheck whether the bundle is satisfied:
brew bundle check --file BrewfileRun:
./check.shThe check script validates Bash syntax, Git config, ShellCheck when installed, the Homebrew bundle when Homebrew is available, and the bootstrap dry-run path.
Some settings are intentionally left manual because they are UI-only, fragile across macOS versions, or need confirmation on each machine.
- Xcode from the App Store or Apple Developer downloads.
- Surge.
- AdGuard.
- ChatGPT.
- Codex.
- Dash.
- Control Center visibility:
- Wi-Fi.
- Bluetooth.
- Clock.
- Accessibility:
- Use three fingers to drag.
- Spotlight:
- Disable where desired.
- Displays:
- True Tone.
- Display P3.
- Keyboard:
- Disable Fn behavior where desired.
- Disable Spotlight shortcut.
- Switch CapsLock and Control.
- Use CapsLock to switch input source.
- Trackpad:
- Tap with three fingers to look up.
- Scroll between pages with two fingers.
- Swipe between full-screen apps with four fingers.
- Mission Control with four fingers.
- App Expose with four fingers.
- Locations:
- Set DerivedData to Relative.
- Set Build Location to Relative to Derived Data.
- General:
- Show all file extensions.
- Editing:
- Prefer indent using spaces.
- Indent width 2.
Before replacing an existing file, bootstrap creates a timestamped backup such as:
~/.zshrc.backup.20260507-153000
If a rerun is needed, execute ./bootstrap.sh again. The scripts are designed to be idempotent and avoid duplicate shell hooks.