Guest User

Untitled

a guest
Sep 25th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. # Check for updates on initial load...
  2. if [ "$DISABLE_AUTO_UPDATE" != "true" ]
  3. then
  4. /usr/bin/env ZSH=$ZSH zsh $ZSH/tools/check_for_upgrade.sh
  5. fi
  6.  
  7. # Initializes Oh My Zsh
  8.  
  9. # add a function path
  10. fpath=($ZSH/functions $ZSH/completions $fpath)
  11.  
  12. # Load all of the config files in ~/oh-my-zsh that end in .zsh
  13. # TIP: Add files you don't want in git to .gitignore
  14. for config_file ($ZSH/lib/*.zsh) source $config_file
  15.  
  16. # Set ZSH_CUSTOM to the path where your custom config files
  17. # and plugins exists, or else we will use the default custom/
  18. if [[ -z "$ZSH_CUSTOM" ]]; then
  19. ZSH_CUSTOM="$ZSH/custom"
  20. fi
  21.  
  22.  
  23. is_plugin() {
  24. local base_dir=$1
  25. local name=$2
  26. test -f $base_dir/plugins/$name/$name.plugin.zsh \
  27. || test -f $base_dir/plugins/$name/_$name
  28. }
  29. # Add all defined plugins to fpath. This must be done
  30. # before running compinit.
  31. for plugin ($plugins); do
  32. if is_plugin $ZSH_CUSTOM $plugin; then
  33. fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
  34. elif is_plugin $ZSH $plugin; then
  35. fpath=($ZSH/plugins/$plugin $fpath)
  36. fi
  37. done
  38.  
  39. # Load and run compinit
  40. autoload -U compinit
  41. compinit -i
  42.  
  43.  
  44. # Load all of the plugins that were defined in ~/.zshrc
  45. for plugin ($plugins); do
  46. if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
  47. source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
  48. elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
  49. source $ZSH/plugins/$plugin/$plugin.plugin.zsh
  50. fi
  51. done
  52.  
  53. # Load all of your custom configurations from custom/
  54. for config_file ($ZSH_CUSTOM/*.zsh) source $config_file
  55.  
  56. # Load the theme
  57. if [ "$ZSH_THEME" = "random" ]
  58. then
  59. themes=($ZSH/themes/*zsh-theme)
  60. N=${#themes[@]}
  61. ((N=(RANDOM%N)+1))
  62. RANDOM_THEME=${themes[$N]}
  63. source "$RANDOM_THEME"
  64. echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
  65. else
  66. if [ ! "$ZSH_THEME" = "" ]
  67. then
  68. if [ -f "$ZSH/custom/$ZSH_THEME.zsh-theme" ]
  69. then
  70. source "$ZSH/custom/$ZSH_THEME.zsh-theme"
  71. else
  72. source "$ZSH/themes/$ZSH_THEME.zsh-theme"
  73. fi
  74. fi
  75. fi
Add Comment
Please, Sign In to add comment