Organizing tooling settings using dotfiles
October 29, 2019
Dotfiles are a file that has a filename that is usually prefixed with a dot (period) like
.vimrc. This means they are usually hidden by default on most operating systems. Most of them live in your home directory (although projects can have local dotfiles that override global settings such as
You can see your global dotfiles by listing the hidden files in your home directory:
cd ~ls -a
Some tools generate dotfiles automatically. Others you can add and manage yourself. For example, here are a some dotfiles for the tools I use:
.gitconfigis used by Git for configuration of my version control.
.vimrcis used by Vim for configuration of my editor.
Brewfileis used by Homebrew for configuration of my global packages.
The beauty of dotfiles is it is how you like to use your tools organized in one place! You can move them to any machine you work on to feel at home. I keep my dotfiles backed up in a Git repo so they can be easily cloned and used on any machine I am on.
Most tools that use dotfiles require their dotfiles to exist in your home directory. So once you organize them in a Git repo like this, you need to symlink (symbolic link) them to your home directory. The
index script at the root of my dotfiles repo is run to do this automatically for any amount of dotfiles in the
#!/bin/shset -euo pipefailecho "Symlinking dotfiles"cd ./filesshopt -s dotglobfor root_file in *; doln -s "$(pwd)/$root_file" "$HOME/$root_file"donecd ..
Dotfiles are a great way to organize your settings and are the default option for many tools. I’d recommend organizing yours in a Git repo like this so that you can keep track of and reproduce your settings on any other machine.