oh-my-zsh.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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/plugins/$plugin/$plugin.plugin.zsh ]; then
  16. source $ZSH/plugins/$plugin/$plugin.plugin.zsh
  17. fi
  18. done
  19. # Load all of your custom configurations from custom/
  20. for config_file ($ZSH/custom/*.zsh) source $config_file
  21. # Load the theme
  22. # Check for updates on initial load...
  23. if [ "$ZSH_THEME" = "random" ]
  24. then
  25. themes=($ZSH/themes/*zsh-theme)
  26. N=${#themes[@]}
  27. ((N=(RANDOM%N)+1))
  28. RANDOM_THEME=${themes[$N]}
  29. source "$RANDOM_THEME"
  30. echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
  31. else
  32. source "$ZSH/themes/$ZSH_THEME.zsh-theme"
  33. fi
  34. # Check for updates on initial load...
  35. if [ "$DISABLE_AUTO_UPDATE" = "true" ]
  36. then
  37. return
  38. else
  39. /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
  40. fi