init.zsh 845 B

123456789101112131415161718192021222324
  1. #
  2. # Displays installation information for not found commands.
  3. #
  4. # Authors:
  5. # Joseph Jon Booker <joe@neoturbine.net>
  6. # Indrajit Raychaudhuri <irc+code@indrajit.com>
  7. #
  8. # Load command-not-found on Debian-based distributions.
  9. if [[ -s /etc/zsh_command_not_found ]]; then
  10. source /etc/zsh_command_not_found
  11. # Load command-not-found on Arch Linux-based distributions.
  12. elif [[ -s /usr/share/doc/pkgfile/command-not-found.zsh ]]; then
  13. source /usr/share/doc/pkgfile/command-not-found.zsh
  14. # Load command-not-found on macOS when Homebrew tap is configured.
  15. elif (( $+commands[brew] )) \
  16. && [[ -s ${hb_cnf_handler::="${HOMEBREW_REPOSITORY:-$commands[brew]:A:h:h}/Library/Taps/homebrew/homebrew-command-not-found/handler.sh"} ]]; then
  17. source "$hb_cnf_handler"
  18. unset hb_cnf_handler
  19. # Return if requirements are not found.
  20. else
  21. return 1
  22. fi