oh-my-zsh.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Initializes Oh My Zsh
  2. # add a function path
  3. fpath=($ZSH/functions $ZSH/completions $fpath)
  4. # Load all of the config files in ~/oh-my-zsh that end in .zsh
  5. # TIP: Add files you don't want in git to .gitignore
  6. for config_file ($ZSH/lib/*.zsh) source $config_file
  7. # Add all defined plugins to fpath
  8. plugin=${plugin:=()}
  9. for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
  10. # Load and run compinit
  11. autoload -U compinit
  12. compinit -i
  13. # Load all of the plugins that were defined in ~/.zshrc
  14. for plugin ($plugins); do
  15. if [ -f $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh ]; then
  16. source $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh
  17. elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
  18. source $ZSH/plugins/$plugin/$plugin.plugin.zsh
  19. fi
  20. done
  21. # Load all of your custom configurations from custom/
  22. for config_file ($ZSH/custom/*.zsh) source $config_file
  23. # Load the theme
  24. # Check for updates on initial load...
  25. if [ "$ZSH_THEME" = "random" ]
  26. then
  27. themes=($ZSH/themes/*zsh-theme)
  28. N=${#themes[@]}
  29. ((N=(RANDOM%N)+1))
  30. RANDOM_THEME=${themes[$N]}
  31. source "$RANDOM_THEME"
  32. echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
  33. else
  34. source "$ZSH/themes/$ZSH_THEME.zsh-theme"
  35. fi
  36. # Check for updates on initial load...
  37. if [ "$DISABLE_AUTO_UPDATE" = "true" ]
  38. then
  39. return
  40. else
  41. /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
  42. fi