How I use a single .zshrc file on macOS and Windows (WSL2)
Description and use
The author maintains a single .zshrc file for macOS and Windows (WSL2) by storing it in a Git repo and symlinking it in both environments, eliminating duplicate configuration.
Problem
Maintaining separate Zsh configuration files for macOS and Windows (WSL2) leads to duplication and inconsistency.
Outcome
The author now maintains one .zshrc file, reducing duplication and ensuring consistent aliases, functions, and plugins across macOS and WSL2.
Workflow
- 1. Create a Git repository to host the shared .zshrc file.
- 2. Store the .zshrc in the repository root.
- 3. On macOS, add a symlink: ln -s /path/to/repo/.zshrc ~/.zshrc.
- 4. On WSL2, add a symlink: ln -s /mnt/c/path/to/repo/.zshrc ~/.zshrc (or place it in /etc/zsh/zshrc if system-wide).
- 5. Commit and push changes to the repo whenever the configuration is updated.
- 6. Pull the latest changes in both environments to keep them in sync.
Evidence
I use a single .zshrc file on macOS and Windows (WSL2).
- Record date: 2026-09-20T02:45:32.552Z