The primary goals of this repo are:
- Make it easy to setup a new machine to be ready for development work
- Provide tools and workflows for adding dependencies, apps, and so on while also tracking those changes in this repo. This allows other workstations to stay in sync and prevents this repo from becoming outdated.
brew bundle
lets me list dependencies and applications in a declarativeBrewfile
format so that they can then be installed automatically via homebrew and the Mac App Store CLI.mackup
symlinks config files from a git submodule into their target destinations (usually the$HOME
directory).zcompile-many
is a DIY alternative to zsh plugin managers likezplug
(which I previously used). It is configured in.zshrc
and is used to install and load zsh-specific plugins.- A few shell scripts in this repo help with initial bootstrapping and then the upkeep of this system over time.
For my shell prompt, I use starship.rs. It's fast and the default theme and integration with the tools and languages I use is plenty sufficient.
The .zshrc
is broken into phases:
- Path config - loads all
path.zsh
files found in this repo. - General config - loads the remaining
*.zsh
files found in this repo, excludingcompletion.zsh
files (that happens later). - Install zsh plugins - installs and compiles zsh plugins.
- Enable zsh completion.
- Load zsh plugins.
- Completion config - loads all
completion.zsh
files found in this repo. - Finally, initializes the shell prompt.
Finding and automatically loading .zsh
files from this repo in a particular
order allows us to organize zsh config more sensibly rather than putting
everything in .zshrc
. Most of the top-level directories in this repo contain
.zsh
files that provide necessary zsh configuration for those languages,
tools, etc.
- The
Mackup
submodule contains everything thatmackup
syncs. For now, I'm keeping this as a private submodule in case those files contain something sensitive. Ideally these could all be included directly in this repo. - The
private
submodule contains config files, scripts, and gpg keys that need to be kept private and thus can't live in this repo. The scripts below and the shell profile/rc files will check for similarly named files in this submodule and source them appropriately.
For both of these, I have a shell script that I run periodically that commits and pushes any changes within these submodules and then updates the submodule revisions in this parent repo.
,asdf-bootstrap.sh
installs all of the asdf plugins that I use along with the latest version of each of the languages provided by these plugins. Note that this depends on asdf already being installed.,backup.sh
runsmackup backup
to capture the latest config files, then commits and pushes them (via the private submodule), and then updates the submodule ref in the root of this repo.,bootstrap.sh
runs everything needed to setup a new machine, but should also be safe to run at any time.- If a
bootstrap.sh
script exists in theprivate/
submodule, it will be sourced last.
- If a
,brew-bundle.sh
installs homebrew if missing and then runsbrew bundle
to install all dependencies in theBrewfile
- If a
Brewfile
exists in theprivate/
submodule, it will be used to runbrew bundle
, as well.
- If a
,brew-upgrade.sh
runs,brew-bundle.sh
to ensure that Brew and everything in theBrewfile
s are installed. Then upgrades all Brew formulae and casks. Finally updates theBrewfile.lock.json
s.,link.sh
symlinks shell config files from these dotfiles repos into the home and config directories. Used by the,bootstrap.sh
script.,macos.sh
will update Mac OS settings and user preferences.,restore.sh
runsmackup restore
which links all of the config files from theMackup/
submodule into the expected location (typically the HOME directory).- If a
restore.sh
script exists in theprivate/
submodule, it is sourced after runningmackup restore
. This allows for profile-specific linking of configuration files. For example, you may have multiple profiles each with a unique.pip/pip.conf
.
- If a
-
Sign in to Chrome and GitHub
-
Generate SSH keys. Follow these instructions, but name the files based on the GitHub username instead of the defaults.
github-help-generating-ssh-key
Note: Be sure to create a
~/.ssh/config
that uses this SSH key with thegithub.com
host. The bootstrap script below will then override it. -
Clone the dotfiles repo:
mkdir ~/.config; cd ~/.config && git clone [email protected]:ekweible/dotfiles.git && cd dotfiles
-
Clone the two sibling dotfiles repos (private config and the applicable profile config for this machine).
-
Run the bootstrap script:
./bin/,bootstrap.sh
This script is idempotent and safe to run multiple times.
-
See private repo README for configuring Internet Accounts.
- Uncomment the
zprof
lines at the top and bottom of.zshrc
and then load a new shell to see profiling information. - Use zsh-bench.
- V1: Originally forked from atomantic's dotfiles.
- V2: Overall setup inspired by Zach Holman's dotfiles.
- V2: A minimal zsh theme and some iTerm2 configuration inspired by Stefan Judis' iTerm2 + zsh setup.
- V3: A simplified approach that relies on brew bundle for declarative dependencies, mackup for syncing config/settings, and shell config and shell scripts for everything else.
- V4: To improve shell startup time, switched from zplug to custom zsh plugin
management (thanks to zsh-bench!) and switched to
starship.rs for the shell prompt. To improve organization, switched
to a module-based layout with directories containing zsh config for each thing
(like a language or tool) that gets auto-loaded by
.zshrc
.
Huge thanks to all of these people and the resources they've shared!