-
Notifications
You must be signed in to change notification settings - Fork 1
/
apollo-zsh-theme.zsh
29 lines (21 loc) · 877 Bytes
/
apollo-zsh-theme.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
# vim:ft=zsh
typeset -g __APOLLO_INSTALL_DIR="${(%):-%N}"
if [[ -L "$__APOLLO_INSTALL_DIR" ]]; then
__APOLLO_INSTALL_DIR=$(readlink "$__APOLLO_INSTALL_DIR")
fi
__APOLLO_INSTALL_DIR="${__APOLLO_INSTALL_DIR%/*}"
## Compile in background for faster startup
{
for dir in functions modules; do
if [[ ! -s "${__APOLLO_INSTALL_DIR}/${dir}.zwc" \
|| "${__APOLLO_INSTALL_DIR}/${dir}" -nt "${__APOLLO_INSTALL_DIR}/${dir}.zwc" ]]; then
zcompile "${__APOLLO_INSTALL_DIR}/${dir}.tmp.zwc" "${__APOLLO_INSTALL_DIR}/${dir}/"*
mv -f "${__APOLLO_INSTALL_DIR}/${dir}.tmp.zwc" "${__APOLLO_INSTALL_DIR}/${dir}.zwc"
fi
done
} &!
if [[ ${fpath[(ie)"${__APOLLO_INSTALL_DIR}/functions"]} -gt ${#fpath} ]]; then
fpath+=("${__APOLLO_INSTALL_DIR}/functions.zwc" "${__APOLLO_INSTALL_DIR}/functions")
fi
autoload -Uz prompt_apollo_setup
prompt_apollo_setup