-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathzephyr.zsh
48 lines (44 loc) · 1.16 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
48
# Zephyr - Nice as a summer breeze.
# Bootstrap Zephyr.
0=${(%):-%N}
ZEPHYR_HOME=${0:a:h}
source $ZEPHYR_HOME/lib/bootstrap.zsh
# Set which plugins to load. It doesn't really matter if we include plugins we don't
# need (eg: running Linux, not macOS) because the plugins themselves check and exit
# if requirements aren't met.
zstyle -a ':zephyr:load' plugins '_zephyr_plugins' ||
_zephyr_plugins=(
environment
homebrew
color
compstyle
completion
directory
editor
helper
history
prompt
utility
zfunctions
macos
confd
)
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