This repository manages shell, Git, and Vim configuration for macOS and Linux. The setup script prepares the canonical checkout for the current OS and creates links in the home directory.
The configuration is environment-specific. The macOS files expect Homebrew, Java 25, Docker Desktop completion, and the 1Password SSH agent; the Linux files do not configure Git signing or GitHub CLI authentication.
- macOS (
Darwin) or Linux - POSIX
shfor the setup script; Bash can run it as well - Zsh for the installed shell configuration
- Git for checkout and setup
- Homebrew at
/opt/homebrew/binfor the macOS configuration
The macOS configuration also refers to /usr/libexec/java_home, Docker completion files, and the 1Password SSH-agent socket.
Install or adapt those dependencies before using the macOS links on another machine.
Both OS configurations assume Zsh as the login and interactive shell.
The setup script itself uses POSIX sh and continues when Zsh is unavailable, but it prints a warning because the installed shell configuration cannot be used until Zsh is installed.
Clone the repository to the canonical path, then run the setup script.
mkdir -p "$HOME/src/github.com/ssobue"
git clone https://github.com/ssobue/dotfiles.git "$HOME/src/github.com/ssobue/dotfiles"
"$HOME/src/github.com/ssobue/dotfiles/setup-dotfiles.sh"mkdir -p "$HOME/src"
git clone https://github.com/ssobue/dotfiles.git "$HOME/src/dotfiles"
"$HOME/src/dotfiles/setup-dotfiles.sh"The script uses $HOME/src/github.com/ssobue/dotfiles on macOS and $HOME/src/dotfiles on Linux.
If the canonical checkout does not exist, the script clones it before installing links.
The script prints progress messages with the [setup-dotfiles] prefix.
Errors are printed to standard error with the ERROR marker.
| File | macOS target | Linux target | Purpose |
|---|---|---|---|
setup-dotfiles.sh |
Run directly | Run directly | Prepare the checkout and install links |
zshenv.mac |
~/.zshenv |
- | macOS environment variables and PATH |
zshenv.linux |
- | ~/.zshenv |
Linux environment variables |
zshrc.mac |
~/.zshrc |
- | macOS interactive-shell settings |
zshrc.linux |
- | ~/.zshrc |
Linux interactive-shell settings |
gitconfig.mac |
~/.gitconfig |
- | macOS Git settings |
gitconfig.linux |
- | ~/.gitconfig |
Linux Git settings |
gitignore_global.mac |
~/.gitignore_global |
- | macOS global Git ignore rules |
vimrc |
~/.vimrc |
~/.vimrc |
Shared Vim settings |
Edit the files in this repository, not the linked files in the home directory.
The setup script is idempotent:
- A correct link is kept unchanged.
- An incorrect link is replaced.
- A regular file is moved to
<target>.bakbefore the link is created. - An existing
<target>.bakis never overwritten, so setup stops with an error. - Directories are not backed up and may cause link creation to fail.
Home-directory links refer to the repository files, so updating the checkout normally does not require another setup run. Rerun the script after switching operating systems or changing a link manually.
zshenv.macprepends$HOME/.local/bin, JetBrains Toolbox, and/opt/homebrew/binin that order.dotfiles_setup_pathremoves duplicate PATH entries.zshrc.macreapplies the PATH function after macOSpath_helperruns from/etc/zprofile.gitconfig.macincludes the Git identity, SSH signing through 1Password, theghauthentication helper, and the global ignore-file reference.
zshrc.linuxuses GNUlsoptions and loads~/.zshrc_localwhen that file exists.gitconfig.linuxdoes not configure a signing key, commit signing, or a GitHub CLI authentication helper.
The Git identity and signing configuration are machine or user specific. Replace them before distributing the configuration to another user, and keep only values that are safe to publish publicly.
- Use
~/.zshrc_localfor Linux-only personal shell additions. - Update both Git configuration files when changing shared Git behavior.
- Update
gitignore_global.mac,gitconfig.mac,setup-dotfiles.sh, and this file together when changing macOS global Git ignores. - Update the setup script, this file's installed-files table, and the relevant OS-specific files when adding or renaming a managed file.
Do not add private keys, access tokens, passwords, or other non-public information to the repository.
Run these checks after configuration changes:
bash -n setup-dotfiles.sh
sh -n setup-dotfiles.sh
zsh -n zshenv.linux zshenv.mac zshrc.linux zshrc.mac
git config --file gitconfig.mac --list >/dev/null
git config --file gitconfig.linux --list >/dev/null
git diff --checkWhen shellcheck is available, also run:
shellcheck setup-dotfiles.shUse an isolated test HOME and checkout when testing setup behavior.
Do not move or replace files in the real user's home directory during verification.