Personal macOS dotfiles. The repository lives directly in $HOME and tracks a
small allowlist of config files — everything else in the home directory is
ignored by default (see .gitignore, which ignores /* and then
re-includes only the files below).
| Path | Purpose |
|---|---|
.gitconfig |
Git settings, colors, and a large set of aliases. Includes ~/.gitconfig.local for the per-machine user identity. |
.gitignore |
The home-directory allowlist (ignore everything, opt files back in). |
.zshrc |
Zsh / Oh My Zsh configuration. |
Brewfile |
Homebrew packages & casks, installable in one go with brew bundle. |
.hammerspoon/ |
Hammerspoon automation (see below). |
Configured in .hammerspoon/:
| Shortcut | Action |
|---|---|
Ctrl/Option + 1…9, 0 |
Switch to Desktop 1–10 (0 = Desktop 10) |
Option + Shift + 1…9, 0 |
Move the focused window to Desktop N (0 = Desktop 10) |
Option + H / J / K / L |
Focus the window to the left / down / up / right |
Command + F1 / F2 |
Dim / brighten the keyboard backlight one step |
Command + F6 |
Sleep the Mac like closing the lid — or, if caffeinate is running, just lock the screen |
Desktop 10 (
0) only works once you map it in macOS: System Settings → Keyboard → Keyboard Shortcuts → Mission Control → "Switch to Desktop 10" =Ctrl+0. macOS auto-assignsCtrl+1…Ctrl+9but notCtrl+0.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Oh My Zsh manages the zsh configuration:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"The installer creates/overwrites ~/.zshrc from its template, backing up any
existing one to ~/.zshrc.pre-oh-my-zsh.
Because the working tree is the home directory itself (which already contains
files), set the remote up in place rather than a plain git clone:
cd ~
git init
git remote add origin <YOUR_REPO_URL>
git fetch origin
git checkout -f main # -f overwrites the tracked dotfiles with the repo versionsOnly the allowlisted files are touched; the rest of your home directory is left alone.
~/.gitconfig.local is intentionally not tracked, so each machine sets its
own identity. Create it:
cat > ~/.gitconfig.local <<'EOF'
[user]
name = Your Name
email = you@example.com
EOFbrew bundle install --file=~/BrewfileThis installs everything in the Brewfile, including Hammerspoon.
- Launch Hammerspoon (installed in the previous step).
- Grant it Accessibility permission: System Settings → Privacy & Security → Accessibility → enable Hammerspoon. (Required for the window/desktop shortcuts.)
- Click the menu-bar icon → Reload Config.
The hs command-line tool is enabled automatically (require("hs.ipc") in
init.lua), so hs -c "..." works from the terminal after a reload.
After installing or removing Homebrew packages, regenerate the list:
brew bundle dump --force --file=~/BrewfileOther useful commands:
brew bundle check --file=~/Brewfile— report what's missing.brew bundle cleanup --file=~/Brewfile— list packages not in the Brewfile (add--forceto uninstall them).