I'd been using oh-my-zsh and square/maximum-awesome for years, big shout out to them and open-source community, I could fully focus on my projects. Time flies, without paying enough attention to my home folder, it inevitably turns into a mess. It's time to clean it up.
Inspired by @holman/dotfiles, and XDG Base Directory Specification, here are my goals:
- One .dotfiles repo rules all settings.
- All settings could easily apply to another machine.
- Respect XDG Base Directory Specification.
- Everything's built around topic.
- By doing things above, learning and extending my knowledge.
Warning: You should not directly use this repo as your setting unless you fully reviewed the code.
# Clone the repository
git clone https://github.com/abookyun/dotfiles ~/.dotfiles
# Initialize chezmoi and apply dotfiles
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply ~/.dotfilesOn first run, chezmoi will:
- Prompt for your git email and full name
- Create XDG directory structure
- Install Homebrew packages automatically
- Symlink all configuration files
- Terminal: Ghostty with Catppuccin Frappe theme
- Shell: Zsh with Powerlevel10k prompt
- Plugins: vi-mode, syntax-highlighting, autosuggestions, fzf
- Tools: zoxide (smart cd), eza (better ls), bat, ripgrep
- Version Manager: asdf (Ruby, Python, Rust, Node, Postgres, Redis, SQLite)
- Editor: Vim with 26 plugins (Dracula theme, ALE linter, fugitive, fzf.vim)
- Multiplexer: Tmux with Catppuccin theme
- Git: Custom aliases and configuration
- XDG Base Directory compliant - clean home directory
- Managed with chezmoi for flexible dotfiles deployment
- Automated Homebrew package management
- Template-based configuration for machine-specific settings
After applying dotfiles:
- Restart terminal or run
exec zsh - Vim plugins auto-install on first launch
- Tmux plugins: Press
Alt+Space + Ito install - Machine-specific git settings are configured via chezmoi templates
# Check what changes chezmoi would make
chezmoi diff
# Apply changes from source directory
chezmoi apply -v
# Edit a file managed by chezmoi (opens in $EDITOR)
chezmoi edit ~/.zshenv
# Add a new file to be managed
chezmoi add ~/.config/newapp/config.yml
# Update dotfiles from repository
cd ~/.dotfiles
git pull
chezmoi apply -v
# See what files chezmoi is managing
chezmoi managed
# Verify the state of managed files
chezmoi verifyThe following files use chezmoi templates for machine-specific configuration:
.chezmoi.toml.tmpl- Main configuration with git email/name promptsrun_once_before_01-create-xdg-directories.sh.tmpl- XDG directory setuprun_once_after_02-install-brew-packages.sh.tmpl- Homebrew package installation
# Add a new config file and edit it
chezmoi add ~/.config/app/config.yml
chezmoi edit ~/.config/app/config.yml
# Make changes and commit to git
cd ~/.dotfiles
git add .
git commit -m "Update app config"
git push
# Apply on another machine
cd ~/.dotfiles
git pull
chezmoi apply -vbrewupWhen you install new packages, keep your Brewfile in sync:
# Compare Brewfile with currently installed packages
brewdiff
# The output shows:
# - Packages installed but not in Brewfile (add these to your Brewfile)
# - Packages in Brewfile but not installed (either install or remove from Brewfile)Manually add new packages to your Brewfile in the appropriate section with comments to maintain organization.
asdfup
asdf installLocated in functions/ directory:
brewup- Update all Homebrew packagesbrewdiff- Compare Brewfile with installed packagesasdfup- Update all asdf pluginsgitclean- Remove merged git branchesmkcd- Create directory and cd into it