What Are Dotfiles?
Dotfiles are configuration files for various programs on Unix-like operating systems. They're called "dotfiles" because they typically start with a dot (.), which makes them hidden by default in most file managers and terminal listings.
Common examples include:
.bashrc or .zshrc - Shell configuration
.vimrc or .config/nvim/init.lua - Editor configuration
.gitconfig - Git configuration
.tmux.conf - Tmux configuration
Why Should You Care About Dotfiles?
Portability: Move your entire development environment to a new machine in minutes
Consistency: Keep the same setup across multiple machines
Backup: Never lose your carefully crafted configurations
Learning: Study how others configure their tools
Getting Started
Step 1: Create a Dotfiles Repository
``
bash
mkdir ~/.dotfiles
cd ~/.dotfiles
git init
`
Step 2: Move Your Existing Configs
`
bash
mv ~/.zshrc ~/.dotfiles/zshrc
mv ~/.vimrc ~/.dotfiles/vimrc
mv ~/.gitconfig ~/.dotfiles/gitconfig
`
Step 3: Create Symlinks
`
bash
ln -s ~/.dotfiles/zshrc ~/.zshrc
ln -s ~/.dotfiles/vimrc ~/.vimrc
ln -s ~/.dotfiles/gitconfig ~/.gitconfig
`
Step 4: Push to GitHub
`
bash
git add .
git commit -m "Initial dotfiles"
git remote add origin git@github.com:username/dotfiles.git
git push -u origin main
``
Best Practices
Use a bootstrap script: Create a setup script that automates symlinking
Keep secrets separate: Never commit API keys or passwords
Document your setup: Include a README explaining your configurations
Use branches: Test experimental configs on separate branches
Next Steps
Now that you understand the basics, explore Dotfiles Market to discover configurations from other developers and get inspired for your own setup!