diff --git a/zsh/theme.zsh b/zsh/theme.zsh index 50e7eee4..b55d4a54 100644 --- a/zsh/theme.zsh +++ b/zsh/theme.zsh @@ -1 +1,15 @@ +# Re-add prezto module function paths to $fpath. Some flows (compinit's +# insecure-directory check, group-writable home dirs) can strip these, +# which leaves skwp's precmd calling autoload-declared-but-unfindable +# functions like git-info/ruby-info, producing +# "zsh: bad math expression: operand expected at '%F{135}%n%...'" +# and cascading errors in zsh-syntax-highlighting. +() { + local module dir + for module in helper git ruby; do + dir="${ZDOTDIR:-$HOME}/.zprezto/modules/$module/functions" + [[ -d $dir && ${fpath[(I)$dir]} -eq 0 ]] && fpath=($dir $fpath) + done +} + prompt skwp