This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a cross-platform dotfiles repository managed by chezmoi, supporting macOS and various Linux distributions (Debian-based, Arch-based). It provides a complete development environment setup including Git, Neovim, Tmux, and Zsh configurations.
# Apply all configurations (main command)
chezmoi apply
# Preview changes before applying
chezmoi apply --dry-run
# Update to latest configurations from repository
chezmoi update
# Edit chezmoi configuration file
chezmoi edit-config
# Navigate to chezmoi source directory
chezmoi cd
# Initialize and apply (fresh installation)
chezmoi init --apply shdennlin# Edit dotfiles in chezmoi source directory
chezmoi edit <file>
# Apply specific file
chezmoi apply <file>
# Check diff between current and source
chezmoi diff
# Re-run scripts (useful after package installation)
chezmoi apply --force.tmplfiles: Go template files processed by chezmoi with conditional logicrun_*scripts: Executable scripts for system setup and package installationdot_*files: Mapped to dotfiles in home directory (dot_zshrc → ~/.zshrc)
.chezmoi.toml.tmpl: Main configuration template defining user data and feature toggles- Template variables: Available in all
.tmplfiles via{{ .variableName }} - OS detection:
{{ .chezmoi.os }},{{ .chezmoi.osRelease.id }}for platform-specific logic - Feature toggles:
{{ .applyGit }},{{ .applyNeovim }}, etc. control component installation
{{ if eq .chezmoi.os "darwin" -}}
# macOS-specific configuration
{{ else if eq .chezmoi.osRelease.id "ubuntu" -}}
# Ubuntu-specific configuration
{{ end -}}- Uses Delta for enhanced diffs
- Template variables for user info:
{{ .git.name }},{{ .git.email }} - GPG signing support with platform-specific GPG paths
- Cross-platform line ending normalization
- Plugin Manager: Packer (wbthomason/packer.nvim)
- Structure: Modular Lua configuration in
dot_config/nvim/lua/shdennlin/ - Auto-installation:
run_onchange_before_nvim-plugin-checking.sh.tmplhandles Neovim installation - Plugin sync: Automatic PackerSync on plugins.lua changes
- Plugin Manager: TPM (Tmux Plugin Manager)
- Key Bindings: Alt+number for window switching, Ctrl+k for clear
- Plugins: sensible, copycat, pain-control, resurrect, continuum
- Session persistence: tmux-resurrect with custom directory
- Plugin Manager: Znap (marlonrichert/zsh-snap)
- Theme: Powerlevel10k with instant prompt
- Configuration: Modular structure in
dot_zsh/directory - Aliases: Conditional aliases based on available commands via
change_aliasfunction
Configure in chezmoi.toml:
[data]
installUsefulPackages = true # Enable/disable package installation
miniPackages = false # Minimal package set for servers
applyGit = true # Individual component toggles
applyNeovim = true
applyTmux = true
applyZsh = true- macOS: Homebrew bundle with brews and casks
- Linux: Platform-specific package managers (apt, pacman, dnf)
- Package lists: Referenced from
.chezmoidata/packages.toml(external file)
run_before_00-install-pre-requisites.sh- Git dependency checkrun_before_zsh-checking.sh.tmpl- Zsh installationrun_onchange_install-packages-*.sh.tmpl- Package installationrun_onchange_before_*-checking.sh.tmpl- Component-specific setuprun_onchange_after_nvim-plugin-install.sh.tmpl- Post-setup tasks
- Default editor: Neovim with comprehensive plugin setup
- Git integration: Delta syntax highlighting, GPG signing
- Terminal: Tmux with session management and restoration
- Emacs keybindings: Alt+arrow for word movement
- Path management: Automatic detection of common binary paths (/opt/homebrew, ~/.cargo, ~/.local)
- ASDF integration: Automatic PATH configuration for version management
- Font handling: Automatic Nerd Font installation on macOS
- Architecture support: x86_64 and ARM64 considerations
- Package availability: Conditional installation based on platform capabilities
Edit personal information in generated ~/.config/chezmoi/chezmoi.toml:
[data.git]
name = "Your Name"
username = "yourusername"
email = "your.email@example.com"
gpgsign = "true"
signingkey = "your-gpg-key-id"- Use
chezmoi execute-templateto test template syntax - Check
chezmoi datato view all available template variables - Validate with
chezmoi apply --dry-runbefore applying changes
- Permission errors: Ensure script files have execute permissions
- Package installation failures: Check
installUsefulPackagessetting and platform support - Template errors: Validate template syntax and variable availability
- Plugin issues: Re-run
chezmoi apply --forceto trigger plugin installation scripts
- Scripts use hash-based change detection (e.g.,
{{ include "dot_config/nvim/version" | sha256sum }}) - Configuration changes trigger automatic re-execution of relevant scripts