Skip to content

Instantly share code, notes, and snippets.

@caseykulm
Created March 14, 2026 20:48
Show Gist options
  • Select an option

  • Save caseykulm/2373e90380e5835d99bd949780cd8576 to your computer and use it in GitHub Desktop.

Select an option

Save caseykulm/2373e90380e5835d99bd949780cd8576 to your computer and use it in GitHub Desktop.
Readme for how to organize dot files

Dotfiles

Paste the following into ~/.zshrc:

# Source every shell file in .dotfiles
for file in "$HOME/.dotfiles"/*.sh; do
    [[ -e "$file" ]] || continue  # Skip if no .sh files are found
    [[ -r "$file" ]] && source "$file"
done

And the place organized dot files into $HOME/.dotfiles, following the naming scheme section below.

e.g.

➜ .dotfiles > tree
.
├── 1-local-bin.sh
├── 1-ssh-agent.sh
├── 1-zsh-init.sh
├── 3-android.sh
├── 3-google-cloud-sdk.sh
├── 3-gradle-helpers.sh
├── 3-nvm.sh
├── 3-openai.sh
├── 3-sublime-text.sh
├── 4-atuin.sh
├── 5-sdkman-init.sh
├── 6-pyenv.sh
├── 7-python-uv.sh
└── README.md
➜ .dotfiles > cat 3-gradle-helpers.sh
alias gw='./gradlew'
alias gwp='./gradlew -p'

Naming scheme

The shell scripts in this directory will be processed in lexigraphic order. In order to have some control over the order the files will be prefixed.

By default prefix a shell file with 3, e.g. 3-android.sh.

If some new file needs to run earlier, then prefix it with 1-[name].sh or 2-[name].sh.

This should be sufficient for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment