Editor Configuration
Setting Your Editor
By default, chezmoi uses the editor specified by the$VISUAL or $EDITOR environment variables, falling back to:
vion Unix-like systemsnotepad.exeon Windows
~/.config/chezmoi/chezmoi.toml
~/.config/chezmoi/chezmoi.toml
VSCode / VSCodium
VSCode requires the--wait flag to keep chezmoi from continuing before you finish editing:
~/.config/chezmoi/chezmoi.toml
~/.config/chezmoi/chezmoi.toml
Vim
Vim requires the-f (foreground) flag:
~/.config/chezmoi/chezmoi.toml
Vim Plugins
Enhance your chezmoi workflow with these Vim plugins: chezmoi.vim - Syntax highlighting for chezmoi files including templates:chezmoi edit:
Auto-Apply on Save
You can also configure Vim to runchezmoi apply automatically. First, disable hardlinking:
~/.config/chezmoi/chezmoi.toml
~/.vimrc
Neovim
~/.config/chezmoi/chezmoi.toml
Emacs
chezmoi.el provides convenience functions for Emacs (available on MELPA):Helix
Helix 25.01+ works out of the box:~/.config/chezmoi/chezmoi.toml
Diff Tool Configuration
Built-in Diff
By default, chezmoi uses a built-in diff with color output piped through your pager (usuallyless).
If colors aren’t displaying correctly, set:
~/.config/chezmoi/chezmoi.toml
Custom Diff Tool
Use any diff tool by settingdiff.command and diff.args. The templates variables .Destination and .Target contain the file paths:
~/.config/chezmoi/chezmoi.toml
~/.local/share/chezmoi/.chezmoi.toml.tmpl
VSCode as Diff Tool
~/.config/chezmoi/chezmoi.toml
~/.config/chezmoi/chezmoi.toml
Delta
Delta is a syntax-highlighting pager for git, diff, and grep output:~/.config/chezmoi/chezmoi.toml
diff-so-fancy
diff-so-fancy makes diffs more readable:~/.config/chezmoi/chezmoi.toml
Meld
Meld is a visual diff and merge tool:~/.config/chezmoi/chezmoi.toml
Disable Pager
Disable the pager with a flag:~/.config/chezmoi/chezmoi.toml
Exclude Scripts from Diff
By default,chezmoi diff shows script contents. To exclude them:
~/.config/chezmoi/chezmoi.toml
Exclude Externals from Diff
~/.config/chezmoi/chezmoi.toml
Human-Friendly Binary Diffs
chezmoi supports “textconv” to transform binary files before diffing. This is useful for viewing diffs of binary formats.macOS .plist Files
~/.config/chezmoi/chezmoi.toml
PDF Files
~/.config/chezmoi/chezmoi.toml
Images (with exiftool)
~/.config/chezmoi/chezmoi.toml
Merge Tool Configuration
Default Merge Tool
By default, chezmoi usesvimdiff. Configure a custom merge tool with merge.command and merge.args:
Templates variables available:
.Destination- file in destination state.Source- file in source state.Target- file in target state
Neovim
~/.config/chezmoi/chezmoi.toml
VSCode
VSCode requires a wrapper script to provide all four files for 3-way merge:~/.config/chezmoi/chezmoi.toml
Beyond Compare
Beyond Compare is a commercial diff and merge tool:~/.config/chezmoi/chezmoi.toml
Meld
~/.config/chezmoi/chezmoi.toml
KDiff3
~/.config/chezmoi/chezmoi.toml
HTTP/SOCKS5 Proxy
Configure chezmoi to use a proxy for external sources and updates:HTTP Proxy
Set environment variables:~/.config/chezmoi/chezmoi.toml
SOCKS5 Proxy
Flatpak Integration
Tools installed via Flatpak require special invocation.Wrapper Script Approach (Recommended)
Create a wrapper script with the same name as the command:~/bin/keepassxc-cli
~/bin is in your $PATH.
Direct Configuration
For tools with.command and .args config options:
~/.config/chezmoi/chezmoi.toml
Password Manager Integration
chezmoi integrates with many password managers. Each requires configuration:1Password
~/.config/chezmoi/chezmoi.toml
Bitwarden
~/.config/chezmoi/chezmoi.toml
KeePassXC
~/.config/chezmoi/chezmoi.toml
LastPass
~/.config/chezmoi/chezmoi.toml
Pass
~/.config/chezmoi/chezmoi.toml
Shell Completion
chezmoi provides shell completion for bash, zsh, fish, and PowerShell.Bash
Zsh
Fish
PowerShell
Add to your PowerShell profile:Script Interpreters
Override the interpreter for run scripts:~/.config/chezmoi/chezmoi.toml
Custom Umask
Control file permissions:~/.config/chezmoi/chezmoi.toml
~/.ssh/config).
Pinentry for GPG
Configure pinentry for GPG encryption:~/.config/chezmoi/chezmoi.toml
Warnings Configuration
Disable specific warnings:~/.config/chezmoi/chezmoi.toml
Git Configuration
Configure git behavior:~/.config/chezmoi/chezmoi.toml
~/.config/chezmoi/chezmoi.toml
Troubleshooting
Editor Returns Too Quickly
If you see:- VSCode:
--wait - Vim:
-f - Sublime:
-w
Colors Not Showing in Diff
Set theLESS environment variable:
Flatpak Tools Not Found
Ensure your wrapper scripts are:- Executable (
chmod +x) - In your
$PATH - Named exactly like the command