How do I edit my dotfiles with chezmoi?
How do I edit my dotfiles with chezmoi?
chezmoi edit (recommended):re-add doesn’t work with templates.5. Edit target, then merge:What happens if I edit a dotfile without using `chezmoi edit`?
What happens if I edit a dotfile without using `chezmoi edit`?
~/.zshrc directly (without using chezmoi), nothing breaks immediately:Before running chezmoi apply:- Your modified
~/.zshrcremains in place - Changes persist until you run
chezmoi apply
chezmoi apply:- chezmoi detects that
~/.zshrchas changed - You’ll be prompted what to do
- Options: overwrite, keep current, or merge
chezmoi edit to avoid conflicts, or configure auto-apply to see changes immediately.How can I tell what dotfiles aren't managed by chezmoi?
How can I tell what dotfiles aren't managed by chezmoi?
chezmoi unmanaged to see all files that exist in your home directory but aren’t managed by chezmoi:How can I tell what dotfiles are currently managed by chezmoi?
How can I tell what dotfiles are currently managed by chezmoi?
chezmoi managed to list all files managed by chezmoi:How do I tell chezmoi to ignore specific files?
How do I tell chezmoi to ignore specific files?
.chezmoiignore.Create .chezmoiignore in your source directory:How do I commit changes to my dotfiles?
How do I commit changes to my dotfiles?
chezmoi cd (manual):chezmoi git (shortcut):-- before flags:chezmoi addchezmoi editchezmoi apply(with changes)
I've made changes to both the destination and source state. How do I keep both?
I've made changes to both the destination and source state. How do I keep both?
chezmoi merge to resolve differences with a merge tool:- Destination: Current file in your home directory (your local changes)
- Source: File in source state (what chezmoi would apply)
- Target: What the file would become
Can I use chezmoi to manage my shell history?
Can I use chezmoi to manage my shell history?
- Every command creates a change
- Would require a commit for each command
- Would create thousands of commits per day
- Shell history changes too rapidly
- Not practical to sync via git
- End-to-end encrypted
- Real-time sync across machines
- Enhanced search and statistics
- Works with bash, zsh, fish
How do I install prerequisites for templates?
How do I install prerequisites for templates?
curl, jq, etc.), install them with a run_before script:.tmpl extension), or it will be evaluated before the prerequisites are installed.Inject data via environment variables:If you need to pass data to non-template scripts:How do I write a literal `{{` or `}}` in a template?
How do I write a literal `{{` or `}}` in a template?
How do I run a script when an external repo changes?
How do I run a script when an external repo changes?
run_onchange_after_*.tmpl script that includes the HEAD commit:- The template output includes the git HEAD commit hash
- When the external repo updates, HEAD changes
- chezmoi detects the script content changed
- The script runs automatically
How do I run a script periodically (daily, weekly)?
How do I run a script periodically (daily, weekly)?
run_onchange_*.tmpl script with the current date/time truncated to your desired period.Run daily:- The comment contains a date that changes daily/weekly
- chezmoi detects the script content changed
- The script runs automatically
How do I enable shell completions?
How do I enable shell completions?
How do I use tools installed with Flatpak?
How do I use tools installed with Flatpak?
flatpak run. There are two approaches:Approach 1: Wrapper script (recommended):Create a wrapper with the same name as the command:~/bin is in your $PATH. Now chezmoi can find and run keepassxc-cli normally.Approach 2: Direct configuration:For tools with .command and .args config options:chezmoi doctor and feels more natural.See the tools guide for more details.