# ── core.zsh : env / history / compinit / plugins / integrations ─────────────
# env & PATH
() {
local expect
if (( $+commands[nvim] )); then expect=nvim
elif (( $+commands[hx] )); then expect=hx
elif (( $+commands[vim] )); then expect=vim
else expect=vi; fi
assert_eq "EDITOR matches available editor" "$expect" "$(zboot 'print -r -- ${EDITOR:t}')"
}
assert_contains "PATH has ~/.local/bin" "$(zboot 'print -r -- $PATH')" "$HOME/.local/bin"
assert_eq "HOMEBREW_NO_AUTO_UPDATE set" "1" "$(zboot 'print -r -- $HOMEBREW_NO_AUTO_UPDATE')"
assert_eq "CLICOLOR set" "1" "$(zboot 'print -r -- $CLICOLOR')"
assert_eq "no oh-my-zsh sourced" "" "$(zboot 'print -r -- $ZSH')"
[[ -x /opt/homebrew/bin/brew ]] && \
assert_contains "PATH has homebrew bin" "$(zboot 'print -r -- $PATH')" "/opt/homebrew/bin"
# history & options
assert_eq "HISTSIZE large" "100000" "$(zboot 'print -r -- $HISTSIZE')"
assert_eq "SAVEHIST large" "100000" "$(zboot 'print -r -- $SAVEHIST')"
assert_contains "histfile set" "$(zboot 'print -r -- $HISTFILE')" ".zsh_history"
assert_ok "SHARE_HISTORY on" zsh -ic 'source $DOTFILES/.zshrc 2>/dev/null; [[ -o sharehistory ]]'
assert_ok "HIST_IGNORE_ALL_DUPS on" zsh -ic 'source $DOTFILES/.zshrc 2>/dev/null; [[ -o histignorealldups ]]'
# completion (single cached compinit)
assert_ok "compdef available" zsh -ic 'source $DOTFILES/.zshrc 2>/dev/null; whence -w compdef >/dev/null'
assert_ok "compdump created" test -f "$HOME/.cache/zsh/zcompdump"
assert_eq "compinit ran once" "1" "$(zboot 'print -r -- ${_CORE_COMPINIT_COUNT:-0}')"
# plugins
assert_ok "autosuggestions loaded" zsh -ic 'source $DOTFILES/.zshrc 2>/dev/null; typeset -f _zsh_autosuggest_start >/dev/null'
assert_ok "autosuggest async active" zsh -ic 'source $DOTFILES/.zshrc 2>/dev/null; (( ${+ZSH_AUTOSUGGEST_USE_ASYNC} ))'
assert_ok "syntax-highlighting on" zsh -ic 'source $DOTFILES/.zshrc 2>/dev/null; (( ${+ZSH_HIGHLIGHT_VERSION} )) || typeset -f _zsh_highlight >/dev/null'
# integrations (guarded by tool presence)
if (( $+commands[atuin] )); then
assert_ok "atuin search fn defined" zsh -ic 'source $DOTFILES/.zshrc 2>/dev/null; typeset -f _atuin_search >/dev/null'
fi
if (( $+commands[fzf] )); then
assert_ok "fzf history widget" zsh -ic 'source $DOTFILES/.zshrc 2>/dev/null; typeset -f fzf-history-widget >/dev/null'
fi