add ZSH_MODULE_PATH to customize module path when zmodload

This commit is contained in:
Jun Hao 2015-10-26 12:39:44 +08:00
commit 610146751d
4 changed files with 19 additions and 3 deletions

View file

@ -8,7 +8,11 @@ setopt always_to_end
WORDCHARS=''
zmodload -i zsh/complist
if [[ -n $ZSH_MODULE_PATH ]]; then
module_path=$ZSH_MODULE_PATH zmodload -i zsh/complist
else
zmodload -i zsh/complist
fi
## case-insensitive (all),partial-word and then substring completion
if [ "x$CASE_SENSITIVE" = "xtrue" ]; then

View file

@ -92,7 +92,12 @@ function env_default() {
# Required for $langinfo
zmodload zsh/langinfo
if [[ -n $ZSH_MODULE_PATH ]]; then
module_path=$ZSH_MODULE_PATH zmodload zsh/langinfo
else
zmodload zsh/langinfo
fi
# URL-encode a string
#

View file

@ -45,6 +45,9 @@ ZSH_THEME="robbyrussell"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Would you like to use another module_path than zsh compiled with?
# export ZSH_MODULE_PATH=/path/to/zsh-module
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)

View file

@ -1,6 +1,10 @@
#!/usr/bin/env zsh
zmodload zsh/datetime
if [[ -n $ZSH_MODULE_PATH ]]; then
module_path=$ZSH_MODULE_PATH zmodload zsh/datetime
else
zmodload zsh/datetime
fi
function _current_epoch() {
echo $(( $EPOCHSECONDS / 60 / 60 / 24 ))