scd.plugin.zsh 455 B

123456789101112131415161718
  1. ## The scd script should autoload as a shell function.
  2. autoload -Uz scd
  3. ## If the scd function exists, define a change-directory-hook function
  4. ## to record visited directories in the scd index.
  5. if [[ ${+functions[scd]} == 1 ]]; then
  6. chpwd_scd() { scd --add $PWD }
  7. autoload -Uz add-zsh-hook
  8. add-zsh-hook chpwd chpwd_scd
  9. fi
  10. ## Load the directory aliases created by scd if any.
  11. if [[ -s ~/.scdalias.zsh ]]; then
  12. source ~/.scdalias.zsh
  13. fi