Skip to content

Instantly share code, notes, and snippets.

@progrium
Created May 28, 2020 19:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save progrium/ea7cba82a90ac0d06fb2517e21761013 to your computer and use it in GitHub Desktop.
Save progrium/ea7cba82a90ac0d06fb2517e21761013 to your computer and use it in GitHub Desktop.
zsh hook to automatically source/"unsource" directories with .devrc
autoload -U add-zsh-hook
load-devrc() {
if [[ -f .devrc && -r .devrc ]]; then
source .devrc
else
if typeset -f devrc-unset > /dev/null; then
devrc-unset
unset -f devrc-unset
fi
fi
}
add-zsh-hook chpwd load-devrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment