1
0
Fork 0

Added configuration variables for paths

pull/761/head
Alessandro Molari 10 years ago
parent 348c1f84b4
commit 4aa9b5a9a8

@ -11,7 +11,12 @@
# Set PREZTO_DIR to the default value if not already set
if [ -z "${PREZTO_DIR}" ]; then
PREZTO_DIR=${ZDOTDIR:-$HOME}/.zprezto
PREZTO_DIR="${ZDOTDIR:-$HOME}/.zprezto"
fi
# Set PREZTORC to the default value if not already set
if [ -z "${PREZTORC}" ]; then
PREZTORC="${ZDOTDIR:-$HOME}/.zpreztorc"
fi
#
@ -58,19 +63,19 @@ function pmodload {
for pmodule in "$pmodules[@]"; do
if zstyle -t ":prezto:module:$pmodule" loaded 'yes' 'no'; then
continue
elif [[ ! -d "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule" ]]; then
elif [[ ! -d "${PREZTO_DIR}/modules/$pmodule" ]]; then
print "$0: no such module: $pmodule" >&2
continue
else
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/init.zsh"
if [[ -s "${PREZTO_DIR}/modules/$pmodule/init.zsh" ]]; then
source "${PREZTO_DIR}/modules/$pmodule/init.zsh"
fi
if (( $? == 0 )); then
zstyle ":prezto:module:$pmodule" loaded 'yes'
else
# Remove the $fpath entry.
fpath[(r)${ZDOTDIR:-$HOME}/.zprezto/modules/${pmodule}/functions]=()
fpath[(r)${PREZTO_DIR}/modules/${pmodule}/functions]=()
function {
local pfunction
@ -80,7 +85,7 @@ function pmodload {
setopt LOCAL_OPTIONS EXTENDED_GLOB
# Unload Prezto functions.
for pfunction in ${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/functions/$~pfunction_glob; do
for pfunction in ${PREZTO_DIR}/modules/$pmodule/functions/$~pfunction_glob; do
unfunction "$pfunction"
done
}
@ -96,8 +101,8 @@ function pmodload {
#
# Source the Prezto configuration file.
if [[ -s "${ZDOTDIR:-$HOME}/.zpreztorc" ]]; then
source "${ZDOTDIR:-$HOME}/.zpreztorc"
if [[ -s "${PREZTORC}" ]]; then
source ${PREZTORC}
fi
# Disable color and theme in dumb terminals.

Loading…
Cancel
Save