zsh_reload.plugin.zsh 334 B

123456789101112
  1. src() {
  2. local cache="$ZSH_CACHE_DIR"
  3. autoload -U compinit zrecompile
  4. compinit -i -d "$cache/zcomp-$HOST"
  5. for f in ${ZDOTDIR:-~}/.zshrc "$cache/zcomp-$HOST"; do
  6. zrecompile -p $f && command rm -f $f.zwc.old
  7. done
  8. # Use $SHELL if available; remove leading dash if login shell
  9. [[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh
  10. }