main
 1# ZSH modular config entrypoint
 2# Sourced from home-manager's .zshrc after its fpath/plugin setup
 3#
 4# Structure:
 5#   core/   — numbered files loaded in order (helpers, options, completion, prompt, etc.)
 6#   tools/  — per-tool configs (each guards with `has <tool> || return`)
 7#   functions/ — autoloaded functions (zero startup cost)
 8
 9local zsh_dir="${ZDOTDIR:-$HOME/.config/zsh}"
10
11# Register autoloaded functions
12if [[ -d "$zsh_dir/functions" ]]; then
13  fpath=("$zsh_dir/functions" $fpath)
14  autoload -U "$zsh_dir"/functions/*(x:tN)
15fi
16
17# Load core config (numbered for ordering)
18source "$zsh_dir/core/05-helpers.zsh"
19load_zsh_dir "$zsh_dir/core"
20
21# Load tool configs
22load_zsh_dir "$zsh_dir/tools"
23
24# Profiling output (if enabled)
25if (( ${+DEBUG_ZSH_PERF} )); then
26  zprof
27fi