My .dotfiles, configurations and unattended software installs for macOS.
- Installs Homebrew
- Installs Oh My Zsh
- Installs Asdf runtime version manager
- Installs all software in Brewfile
- Copies dotfiles to the user $HOME
You can clone the repository wherever you want, although ~/.dotfiles is preferred. The bootstrap script will pull in the latest version, install all the software and copy dotfiles to their new $HOME.
git clone https://github.com/bcowdery/dotfiles.git ~.dotfiles~/.dotfiles/bootstrap.sh installYou can update your installation at any time by running bootstrap update. It will automatically pull the latest sources from git and invoke Homebrew to update software and install new packages from the Brewfile formulae. The
bootstrap script itself is symlinked to ~/.local/bin during install. After installation, you should be able to call bootstrap from anywhere on your PATH.
bootstrap updateYou can also selectivly update either homebrew, your dotfiles or scripts:
bootstrap update homebrew🚨 Warning! Updating
dotfileswill clobber any changes made to the files in your home directory. Check your~/.zshrcfile for external changes made by other installers before updating!
When setting up a new Mac, you may want to set up some sensible macOS defaults.
~/.dotfiles/macos.sh💡 Note: Be prepared to type in your
sudopassword, like, A LOT. Sudo keep-alive doesn't seem to be working in recent versions of MacOS :(
🧠 These settings are my personal Mac devices. I have strong opnions about things like hot corners, Finder hiding files and other things you might not want for your own environment. Read through the macos.sh file and comment out anything you don't want.
If any of these files exist, they will be sourced along with the main ~/.zshrc. These files provide extension points for the shell environment organized by convention.
.path- Additions to the$PATH.exports- Export environment variables, feature detection etc..aliases- Aliases for commonly used commands.functions- Shell functions.extra- User specific extra's that you generally don't want to commit to github.ssh-agent- Launch ssh-agent to hold private keys for public key authentication
Here’s an example ~/.path file that adds /usr/local/bin to the $PATH:
export PATH="/usr/local/bin:$PATH"The ~/bin/ directory contains handy scripts, usually written in a mix of bash, zsh and zx
These scripts are symlinked to the ~/.local/bin path.
Use the bootstrap update scripts command to update symlinks for new scripts.
You can use ~/.extra to add a few customizations without the need to fork this entire repository, or to add configuration that you don’t want to commit to a public repository.
For example, you can use ~/.extra to configure your Git credentials, leaving the committed .gitconfig free
of user specific configuration.
# Git credentials
# Commented out to prevent people from accidentally committing under my name
#GIT_AUTHOR_NAME="Brian Cowdery"
#GIT_AUTHOR_EMAIL="brian@thebeardeddeveloper.co"
#GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
#GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
#git config --global user.name "$GIT_AUTHOR_NAME"
#git config --global user.email "$GIT_AUTHOR_EMAIL"💡 Note: The
.extrafile is copied once during install and then ignored in future updates.
I use Asdf to manage runtime versions, such as Node, Python, Ruby, etc. Asdf is installed by the Brewfile, but the runtimes themselves must be configured manually by adding plugins and installing selected versison. See the Asdf documentation for more information.
Example NodeJS:
asdf plugin add nodejs
asdf install nodejs latest:22
asdf set --home nodejs latest:22 system💡 List versions in order of preference, use
systemas a fallback to the globally installed version.
🧠 For a complete list of plugins, see the Asdf Plugins repository.
To pin a specific version to a working directory (e.g., a project or git repo), run asdf set <plugin> <version> in the directory.
Example set tool-version:
cd my-project
asdf set nodejs latest:22Source code and examples were taken from all over the place. Special thanks to:
- @mathiasbynens (Mathias Bynens) https://github.com/mathiasbynens/dotfiles
- @mbadolato (Mark Badolato) iTerm2-Color-Schemes
- @kevinSuttle (Kevin Suttle) macOS-Defaults