Commit 1a26cafca9517b88ed2883b4d26a00f694abfe11
1 parent
c62a0b5271
Exists in
master
and in
1 other branch
[FIX] install.sh: Cloning Zsh Config...
error: unknown option `no-tags'
Showing 1 changed file with 0 additions and 2 deletions Inline Diff
repos/robbyrussell/oh-my-zsh/oh-my-zsh.sh
1 | # Check for updates on initial load... | 1 | # Check for updates on initial load... |
2 | if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then | 2 | if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then |
3 | env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh | 3 | env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh |
4 | fi | 4 | fi |
5 | 5 | ||
6 | export ZSH=$ZCFG/packages/oh-my-zsh | ||
7 | |||
8 | # Initializes Oh My Zsh | 6 | # Initializes Oh My Zsh |
9 | 7 | ||
10 | # add a function path | 8 | # add a function path |
11 | fpath=($ZSH/functions $ZSH/completions $fpath) | 9 | fpath=($ZSH/functions $ZSH/completions $fpath) |
12 | 10 | ||
13 | # Load all stock functions (from $fpath files) called below. | 11 | # Load all stock functions (from $fpath files) called below. |
14 | autoload -U compaudit compinit | 12 | autoload -U compaudit compinit |
15 | 13 | ||
16 | : ${ZSH_DISABLE_COMPFIX:=true} | 14 | : ${ZSH_DISABLE_COMPFIX:=true} |
17 | 15 | ||
18 | # Set ZSH_CUSTOM to the path where your custom config files | 16 | # Set ZSH_CUSTOM to the path where your custom config files |
19 | # and plugins exists, or else we will use the default custom/ | 17 | # and plugins exists, or else we will use the default custom/ |
20 | if [[ -z "$ZSH_CUSTOM" ]]; then | 18 | if [[ -z "$ZSH_CUSTOM" ]]; then |
21 | ZSH_CUSTOM="$ZSH/custom" | 19 | ZSH_CUSTOM="$ZSH/custom" |
22 | fi | 20 | fi |
23 | 21 | ||
24 | # Set ZSH_CACHE_DIR to the path where cache files should be created | 22 | # Set ZSH_CACHE_DIR to the path where cache files should be created |
25 | # or else we will use the default cache/ | 23 | # or else we will use the default cache/ |
26 | if [[ -z "$ZSH_CACHE_DIR" ]]; then | 24 | if [[ -z "$ZSH_CACHE_DIR" ]]; then |
27 | ZSH_CACHE_DIR="$ZSH/cache/" | 25 | ZSH_CACHE_DIR="$ZSH/cache/" |
28 | fi | 26 | fi |
29 | 27 | ||
30 | 28 | ||
31 | # Load all of the config files in ~/oh-my-zsh that end in .zsh | 29 | # Load all of the config files in ~/oh-my-zsh that end in .zsh |
32 | # TIP: Add files you don't want in git to .gitignore | 30 | # TIP: Add files you don't want in git to .gitignore |
33 | for config_file ($ZSH/lib/*.zsh); do | 31 | for config_file ($ZSH/lib/*.zsh); do |
34 | custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}" | 32 | custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}" |
35 | [ -f "${custom_config_file}" ] && config_file=${custom_config_file} | 33 | [ -f "${custom_config_file}" ] && config_file=${custom_config_file} |
36 | source $config_file | 34 | source $config_file |
37 | done | 35 | done |
38 | 36 | ||
39 | 37 | ||
40 | is_plugin() { | 38 | is_plugin() { |
41 | local base_dir=$1 | 39 | local base_dir=$1 |
42 | local name=$2 | 40 | local name=$2 |
43 | test -f $base_dir/plugins/$name/$name.plugin.zsh \ | 41 | test -f $base_dir/plugins/$name/$name.plugin.zsh \ |
44 | || test -f $base_dir/plugins/$name/_$name | 42 | || test -f $base_dir/plugins/$name/_$name |
45 | } | 43 | } |
46 | # Add all defined plugins to fpath. This must be done | 44 | # Add all defined plugins to fpath. This must be done |
47 | # before running compinit. | 45 | # before running compinit. |
48 | for plugin ($plugins); do | 46 | for plugin ($plugins); do |
49 | if is_plugin $ZSH_CUSTOM $plugin; then | 47 | if is_plugin $ZSH_CUSTOM $plugin; then |
50 | fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) | 48 | fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) |
51 | elif is_plugin $ZSH $plugin; then | 49 | elif is_plugin $ZSH $plugin; then |
52 | fpath=($ZSH/plugins/$plugin $fpath) | 50 | fpath=($ZSH/plugins/$plugin $fpath) |
53 | fi | 51 | fi |
54 | done | 52 | done |
55 | 53 | ||
56 | # Figure out the SHORT hostname | 54 | # Figure out the SHORT hostname |
57 | if [[ "$OSTYPE" = darwin* ]]; then | 55 | if [[ "$OSTYPE" = darwin* ]]; then |
58 | # OS X's $HOST changes with dhcp, etc. Use ComputerName if possible. | 56 | # OS X's $HOST changes with dhcp, etc. Use ComputerName if possible. |
59 | SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/} | 57 | SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/} |
60 | else | 58 | else |
61 | SHORT_HOST=${HOST/.*/} | 59 | SHORT_HOST=${HOST/.*/} |
62 | fi | 60 | fi |
63 | 61 | ||
64 | # Save the location of the current completion dump file. | 62 | # Save the location of the current completion dump file. |
65 | if [ -z "$ZSH_COMPDUMP" ]; then | 63 | if [ -z "$ZSH_COMPDUMP" ]; then |
66 | ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}" | 64 | ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}" |
67 | fi | 65 | fi |
68 | 66 | ||
69 | if [[ $ZSH_DISABLE_COMPFIX != true ]]; then | 67 | if [[ $ZSH_DISABLE_COMPFIX != true ]]; then |
70 | # If completion insecurities exist, warn the user without enabling completions. | 68 | # If completion insecurities exist, warn the user without enabling completions. |
71 | if ! compaudit &>/dev/null; then | 69 | if ! compaudit &>/dev/null; then |
72 | # This function resides in the "lib/compfix.zsh" script sourced above. | 70 | # This function resides in the "lib/compfix.zsh" script sourced above. |
73 | handle_completion_insecurities | 71 | handle_completion_insecurities |
74 | # Else, enable and cache completions to the desired file. | 72 | # Else, enable and cache completions to the desired file. |
75 | else | 73 | else |
76 | compinit -d "${ZSH_COMPDUMP}" | 74 | compinit -d "${ZSH_COMPDUMP}" |
77 | fi | 75 | fi |
78 | else | 76 | else |
79 | compinit -i -d "${ZSH_COMPDUMP}" | 77 | compinit -i -d "${ZSH_COMPDUMP}" |
80 | fi | 78 | fi |
81 | 79 | ||
82 | # Load all of the plugins that were defined in ~/.zshrc | 80 | # Load all of the plugins that were defined in ~/.zshrc |
83 | for plugin ($plugins); do | 81 | for plugin ($plugins); do |
84 | if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then | 82 | if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then |
85 | source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh | 83 | source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh |
86 | elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then | 84 | elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then |
87 | source $ZSH/plugins/$plugin/$plugin.plugin.zsh | 85 | source $ZSH/plugins/$plugin/$plugin.plugin.zsh |
88 | fi | 86 | fi |
89 | done | 87 | done |
90 | 88 | ||
91 | # Load all of your custom configurations from custom/ | 89 | # Load all of your custom configurations from custom/ |
92 | for config_file ($ZSH_CUSTOM/*.zsh(N)); do | 90 | for config_file ($ZSH_CUSTOM/*.zsh(N)); do |
93 | source $config_file | 91 | source $config_file |
94 | done | 92 | done |
95 | unset config_file | 93 | unset config_file |
96 | 94 | ||
97 | # Load the theme | 95 | # Load the theme |
98 | if [ "$ZSH_THEME" = "random" ]; then | 96 | if [ "$ZSH_THEME" = "random" ]; then |
99 | themes=($ZSH/themes/*zsh-theme) | 97 | themes=($ZSH/themes/*zsh-theme) |
100 | N=${#themes[@]} | 98 | N=${#themes[@]} |
101 | ((N=(RANDOM%N)+1)) | 99 | ((N=(RANDOM%N)+1)) |
102 | RANDOM_THEME=${themes[$N]} | 100 | RANDOM_THEME=${themes[$N]} |
103 | source "$RANDOM_THEME" | 101 | source "$RANDOM_THEME" |
104 | echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." | 102 | echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." |
105 | else | 103 | else |
106 | if [ ! "$ZSH_THEME" = "" ]; then | 104 | if [ ! "$ZSH_THEME" = "" ]; then |
107 | if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then | 105 | if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then |
108 | source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" | 106 | source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" |
109 | elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then | 107 | elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then |
110 | source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" | 108 | source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" |
111 | else | 109 | else |
112 | source "$ZSH/themes/$ZSH_THEME.zsh-theme" | 110 | source "$ZSH/themes/$ZSH_THEME.zsh-theme" |
113 | fi | 111 | fi |
114 | fi | 112 | fi |
115 | fi | 113 | fi |
116 | 114 |