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

Loading…
Cancel
Save