scd.plugin.zsh 552 B

12345678910111213141516171819
  1. ## The scd script should autoload as a shell function.
  2. autoload 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. scd_chpwd_hook() { scd --add $PWD }
  7. autoload add-zsh-hook
  8. add-zsh-hook chpwd scd_chpwd_hook
  9. fi
  10. ## Allow scd usage with unquoted wildcard characters such as "*" or "?".
  11. alias scd='noglob scd'
  12. ## Load the directory aliases created by scd if any.
  13. if [[ -s ~/.scdalias.zsh ]]; then source ~/.scdalias.zsh; fi