Joshua's Docs - Notes on Dotfiles and portable config ecosystems
Light

Resources

What & Link Type
ArchLinux Wiki: Dotfiles Intro and partial guide
"GitHub Does Dotfiles"
   - Utilities
Collection of helpful links to dotfile repos, tools, and more.

If you are looking for a collection of dotfiles to get you started, here are some popular ones:

What are Dotfiles?

Historically, the term dotfiles refers to files that begin with . (a single dot) which are used to store configurations, command aliases, and settings. Files like:

  • .bashrc
  • .curlrc
  • .tmux.conf

The use of a leading . also makes these files easy to pattern match against

The term is now slightly misleading, as many configuration files no longer use this filename pattern, and it is common to now see configuration files in the form of config.json, config.yml, or other filename patterns that do not adhere to \.+.

Dotfile Conventions

If you look at a bunch of popular and well-maintained dotfile collections, you might start to notice certain patterns.

  • bootstrap.sh
    • Many collections contain a bootstrap script that handles the initial install and setup process for the collection. This is often included as ./boostrap.sh, or perhaps ./scripts/bootstrap.
  • /{program}
    • Many collections separate out aliases, settings, and scripts, by the program(s) they go with. So you might see a ./git/ directory, as well as ./node/, ./vscode/, etc.
  • /bin
    • Separate from organizing by program, some collections contain a /bin directory. This usually contains executable scripts, whereas the other files in the collection are aliases or configurations.

There are many more patterns and files than discussed here; the fun part of dotfiles is that you get to customize them to your exact liking! First and foremost, your dotfiles should be to improve your own DX :)

Dotfile Management

Version Control Your Dotfiles

Using version control, such as git, to manage your dotfiles is a common approach with many benefits. You get out-of-the-box:

  • Secure synchronization
  • Version history
  • Collaboration (if you let others fork or make PRs to your repo)
  • Dependency support (via submodules)
  • And more!

If you create a repository named dotfiles on GitHub, it can also be automatically pulled into new Codespaces.

The specifics of how to set this up are varied. Some users might take the bare repository approach, while other might use a setup script (commonly named bootstrap) that symlinks or copies the files.

Dotfile Utilities

As an alternative to using Version Control to manage your dotfiles, or perhaps to supplement it, there are many utility programs that can help with using dotfiles.

💡 dotfiles.github.io/utilities is a good starting spot for finding these utilities

One popular option for dotfile management is chezmoi, which also has a comparison table of different dotfile management solutions.

Markdown Source Last Updated:
Sun Sep 05 2021 21:39:10 GMT+0000 (Coordinated Universal Time)
Markdown Source Created:
Sat Jul 31 2021 23:00:17 GMT+0000 (Coordinated Universal Time)
© 2021 Joshua Tzucker, Built with Gatsby
Feedback