My small zsh + Vim setup for a new Mac. This replaces the old KDE/Konsole setup; the Linux configuration remains available in Git history.
Rendered from isolated zsh and Vim sessions using these dotfiles and a demo
project. These are terminal-output previews, not native macOS screenshots;
font rendering can differ slightly. The Vim sidebar is narrowed and its help
banner hidden with netrw's I key.
zsh — minimal Apple-inspired palette, light and dark
Vim — One Light
Vim — One Dark
Requires macOS 26 or later, Xcode Command Line Tools (Git, Swift and Python 3), and Homebrew. Apple Terminal on these macOS versions supports the true-color Vim themes. Apple silicon and Intel Homebrew paths are supported.
If needed, run xcode-select --install and finish Apple's installer. Install
Homebrew using its official instructions. Then keep this checkout somewhere
permanent:
mkdir -p ~/Projects
git clone https://github.com/mrousavy/dotfiles.git ~/Projects/dotfiles
cd ~/Projects/dotfiles
./install.sh --dry-run
./install.sh
python3 scripts/doctor.pyOpen a new Terminal window and restart Vim afterward. The shell prefers Homebrew's Vim so current completion and bundled commenting features work even if Apple's bundled Vim is older. The installer checks the required features.
For an AI agent:
Clone mrousavy/dotfiles into ~/Projects/dotfiles, read AGENTS.md and README.md, and set up this Mac. Install the prerequisites and dependencies, preserve existing configuration using the installer backups, restore the documented macOS and Terminal preferences, and run the verification checks. Report any remaining manual steps.
| Component | Configuration |
|---|---|
| zsh | Minimal adaptive palette: gray folder, blue accents, green strings, red errors; bold input; centered greeting; ls after changing directories; .., ..., .... aliases |
| Completion | Case-insensitive Tab matching, highlighted selection, arrow-key navigation |
| zsh plugins | Homebrew's zsh-autosuggestions and zsh-syntax-highlighting |
| History | Up/Down Arrow step through commands that start with the typed text and place the cursor at the end; keep the newest occurrence of each command; skip duplicate search results and saved entries |
| Login banner | .hushlogin hides “Last login” |
| Global Git ignore | .DS_Store, Vim swap files (.*.sw?), and Vim undo files (*.un~) |
| Agent instructions | One global instructions file for Claude Code and Codex, ~/.config/ai/AGENTS.md |
| Vim | Absolute line numbers, no cursor-line highlight, wrapping, two-space indentation, smart-case search, command suggestions while typing |
| Comments/browser | Vim's bundled comment package and netrw; no separate commentary or file-tree plugin |
| Vim plugins | GitGutter, vim-lumen and vim-one, pinned in plugins.json |
| Vim appearance | One Light / One Dark, selected automatically from macOS appearance |
The shell's palette is defined directly in .zshrc, using the existing plugins.
It checks macOS appearance before each new prompt and updates the colors when
it changes. Press Enter after switching appearance to refresh an idle prompt.
Terminal's adaptive profile controls the background and ordinary output colors.
Vim-lumen compiles a small Swift helper inside its plugin directory. It runs as a child process while Vim is open and waits for appearance-change notifications. It installs no system-wide service or login item. Each Vim instance has its own helper. Theme switching is local to the Mac running Vim, not a remote SSH host.
The holyclean command is preserved: it runs git clean -dfX, deleting
ignored files such as build output. Use it deliberately. Its optional sound is
configured with HOLYCLEAN_SOUND in .zshrc.local; no old machine's audio path
or media file is included.
The global Git ignore is installed at ~/.config/git/ignore, Git's default
location. It contains only the three patterns listed above. Project-specific
ignores belong in each repository's .gitignore. If you customize
XDG_CONFIG_HOME or core.excludesFile, configure Git to use this file at its
installed location. Git identity and authentication settings remain local.
Global instructions for coding agents live in .config/ai/AGENTS.md and are
installed at ~/.config/ai/AGENTS.md. Claude Code reads global instructions
from ~/.claude/CLAUDE.md and Codex from ~/.codex/AGENTS.md, so the
installer links both to the same file. Agents pick up edits in their next
session. The top-level AGENTS.md is for agents working on this repository.
These are deliberately separate from shell/editor installation:
# Disable ordinary desktop-wallpaper clicks hiding windows.
python3 scripts/macos.py --wallpaper --dry-run
python3 scripts/macos.py --wallpaper
# Restore Finder, Dock and native window-tiling preferences.
python3 scripts/macos.py --finder --dock --windows --dry-run
python3 scripts/macos.py --finder --dock --windows
# Restore the captured adaptive Basic-derived Terminal settings.
python3 scripts/macos.py --terminal --dry-run
python3 scripts/macos.py --terminalSelect any combination of these flags:
| Flag | Preferences restored |
|---|---|
--finder |
Show hidden files/folders and all filename extensions |
--dock |
Auto-hide on, zero reveal delay, normal slide animation, recent/suggested apps hidden, magnification on, icon sizes 52 / 71, manual resizing unlocked |
--windows |
Native left/right edge tiling and top-edge fill enabled, tiled-window margins off |
--wallpaper |
Ordinary wallpaper clicks do not hide windows |
--terminal |
Adaptive Dotfiles Terminal profile |
The Dock's animation-speed override is removed to restore the macOS default animation. Finder, Dock and window options update individual preference keys; pinned Dock apps and unrelated settings are preserved. Settings are read back after writing, and repeat runs skip matching values.
Log out and back in for all desktop changes to take effect. To refresh Finder and Dock sooner, finish any Finder operations, then run:
killall Finder
killall DockThe script does not restart these apps automatically.
The Terminal import requires Apple Terminal to be closed so it cannot overwrite preferences on exit. Run it from another terminal app or an agent's shell. It adds a profile named Dotfiles and makes it the startup/default profile, retaining other profiles. The profile captures the current font and window preferences without fixed RGB colors, so it follows system appearance. The separate Vim colorscheme supplies One Light/Dark inside the editor.
Each changed preference domain is backed up first in
~/.local/state/dotfiles/backups/<timestamp>/<domain>.plist. Keep these backups
local; they contain the previous preferences for that Mac. Only the settings
listed above are restored by this repository.
install.sh does not install these, and the dotfiles work without them.
| App | What it does | Install |
|---|---|---|
| LinearMouse | Per-device mouse settings, such as scroll direction and pointer acceleration | brew install --cask linearmouse |
| Magnet | Snap windows into halves, thirds and quarters with shortcuts or by dragging | Mac App Store |
install.shlinks.zshrc,.vimrc,.hushlogin,.config/git/ignore,.config/ai/AGENTS.md,.claude/CLAUDE.mdand.codex/AGENTS.mdto this checkout. Keep the checkout in place; editing a linked file edits the repository.- Replaced files, links and plugin directories go to
~/.local/state/dotfiles/backups/<timestamp>/, with amanifest.jsonmapping original paths to backups. Restore by removing the installed link and moving the corresponding backup to its original path. Do not delete the backup first. - An identical link/plugin is left alone on subsequent runs. A different or modified plugin checkout is backed up, not reset. A failed plugin download leaves the previous plugin in place.
- Homebrew dependencies come from Brewfile and follow available Homebrew
releases; they are not binary-version locked. Installation uses
--no-upgrade. Review and runbrew upgrade vim zsh-autosuggestions zsh-syntax-highlightingwhen you want newer releases. Rerun the doctor after upgrades. .zshrc.localand.vimrc.localhold machine-specific settings/secrets and are not committed. Existing.zprofile, Git identity, SSH configuration, language managers and shell history are not replaced.- Put optional personal Homebrew packages in ignored
Brewfile.localand runbrew bundle --file=Brewfile.localseparately. --skip-packagesskips package installation but verifies dependencies;--link-onlyonly installs the links (plugins must already exist).--target /some/directoryinstalls into another destination for testing. Never point it at the repository itself. It does not change HOME or redirect Homebrew: a full install still uses the Mac's Homebrew installation.- No automatic plugin updates: change reviewed commit SHAs in plugins.json, run the installer again, and verify. Git history is the change log.
| Vim keys | Action |
|---|---|
Esc |
Cancel a pending command / return to Normal mode |
Space then e |
Toggle netrw's left sidebar |
Ctrl+w, then h/j/k/l |
Focus left/down/up/right split |
Ctrl+w, then > / < |
Widen / narrow the focused split |
gcc / visual selection then gc |
Toggle comments |
Space then h |
Clear search highlighting |
[c / ]c |
Previous / next Git change |
Space then h p / h s / h u |
Preview / stage / undo a Git hunk |
:w, :q |
Save / close |
The short Space-h mapping shares a prefix with GitGutter's longer mappings;
Vim briefly waits to see whether you continue with p, s or u.
Normal terminal Command-C/V remain available; Vim's clipboard is not globally
redirected. Mouse mode and persistent undo are not enabled.
bash -n install.sh
zsh -n .zshrc
python3 -m unittest discover -s tests -v
python3 scripts/doctor.pyThe doctor checks plugin revisions, shell completion, Vim mappings/preferences, both actual theme palettes, and the running appearance helper. CI also installs twice into an isolated destination to exercise repeat runs. It does not change the user's macOS appearance. In a real Terminal window, also verify Tab menu highlighting and toggle macOS appearance while Vim is open. Color rendering and OS notification delivery need that final visual check.



