forked from mattmc3/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zephyr.zsh
47 lines (44 loc) · 1.09 KB
/
zephyr.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Zephyr - Nice as a summer breeze.
# Bootstrap Zephyr.
0=${(%):-%N}
ZEPHYR_HOME=${0:a:h}
source $ZEPHYR_HOME/lib/bootstrap.zsh
# Load plugins.
zstyle -a ':zephyr:load' plugins '_zephyr_plugins'
if (( ${#_zephyr_plugins} == 0 )); then
_zephyr_plugins=(
environment
color
completion
directory
editor
helper
history
prompt
utility
zfunctions
)
if [[ "$OSTYPE" == darwin* ]]; then
_zephyr_plugins=(homebrew $_zephyr_plugins macos)
fi
_zephyr_plugins+=(confd)
fi
for _zephyr_plugin in $_zephyr_plugins; do
# Allow overriding plugins.
_initfiles=(
${ZSH_CUSTOM:-$__zsh_config_dir}/plugins/${_zephyr_plugin}/${_zephyr_plugin}.plugin.zsh(N)
$ZEPHYR_HOME/plugins/${_zephyr_plugin}/${_zephyr_plugin}.plugin.zsh(N)
)
if (( $#_initfiles )); then
source "$_initfiles[1]"
if [[ $? -eq 0 ]]; then
zstyle ":zephyr:plugin:$_zephyr_plugin" loaded 'yes'
else
zstyle ":zephyr:plugin:$_zephyr_plugin" loaded 'no'
fi
else
echo >&2 "zephyr: Plugin not found '$_zephyr_plugin'."
fi
done
# Clean up.
unset _zephyr_plugin{s,} _initfiles