“Dotfiles” is a term that refers to configuration files used to configure software and operating systems. They are called such because often these files start with a dot. You may have seen .bashrc
, .tmux.conf
or .zshrc
in the wild.
I love whenever I can configure something with config files because it enables me to store them, clone them, store them in version control and easily sync my configs across all my devices.
├── 221
│ └── Library
│ └── Application Support
│ └── liiga_teletext
│ ├── .gitignore
│ └── config.toml
├── 221-linux
│ └── .config
│ └── liiga_teletext
│ └── config.toml
├── 235
│ ├── .235.config
│ ├── .stow-local-ignore
│ └── readme.md
├── README.md
├── brew
│ ├── .stow-local-ignore
│ ├── brew.casks.list
│ ├── brew.list
│ ├── install.sh
│ └── readme.md
├── git
│ └── .gitconfig
| └── .global-gitignore
├── macos-defaults
│ ├── .stow-local-ignore
│ ├── readme.md
│ └── settings.sh
├── nvim
│ └── .config
│ └── nvim
│ ├── LICENSE
│ ├── README.md
│ ├── init.lua
│ ├── lazy-lock.json
│ ├── lazyvim.json
│ ├── lua
│ │ └── config
│ │ ├── autocmds.lua
│ │ ├── keymaps.lua
│ │ ├── lazy.lua
│ │ └── options.lua
│ └── stylua.toml
├── python
│ └── .config
│ └── python
│ └── python_startup.py
├── sqlite
│ └── .sqliterc
├── starship
│ └── .config
│ └── starship.toml
├── stylus
│ ├── readme.md
│ └── stylus.json
├── tmux
│ └── .config
│ └── tmux
│ ├── plugins/ (truncated for readability)
│ ├── tmux.conf
│ └── tmux.local.conf
├── vscode
│ ├── .stow-local-ignore
│ ├── Library
│ │ └── Application Support
│ │ └── Code
│ │ └── User
│ │ ├── keybindings.json
│ │ └── settings.json
│ ├── extensions.list
│ └── readme.md
└── zshrc
├── .zsh_aliases
└── .zshrc
I have two types of configuration files.
Managed with GNU Stow
First group I configure with GNU Stow: it links a sub-directory (like tmux
in the hierarchy above) to home folder with symbolic links. This means whenever I change something in my dotfiles/
folder, it changes in home folder where the applications pick configurations from. It also means that if I change something in my home folder, it updates them in the dotfiles/
folder so they stay synced in my version control repository.
Managed (semi-)manually
Others have custom ways to use them with individual instructions. For example, in brew/
, I have a custom install.sh
script that installs packages and casks. It looks like this
#!/bin/bash
echo "Installing brew formulas from list..."
cat brew.list | cut -d':' -f1 | xargs brew install
echo "Installing brew casks from list..."
cat brew.casks.list | cut -d':' -f1 | xargs brew install
Whenever it’s possible to apply or export configurations from command line, I like to build scripts for them because I tend to do them rarely. I’d never remember how to do it and sometimes there might be multiple steps involved so automating processes is always good.
In stylus/
, I keep my custom CSS styles that I need to import and export manually through the browser extension Stylus.
All of these that aren’t managed with GNU Stow need to be manually kept in sync because there’s no way to use symlinks with them. That’s a bit cumbersome. I have a monthly task in my todo list to do exports and update the repository.