oh-my-zsh.sh 1.3 KB

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