oh-my-zsh.sh 1.3 KB

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