mirror of
https://github.com/zdharma-continuum/history-search-multi-word
synced 2024-11-21 19:03:11 +00:00
plugin.zsh: Standard $0 handling and $fpath extending
This commit is contained in:
parent
d343cd0d7f
commit
71e00938a7
1 changed files with 10 additions and 4 deletions
|
@ -7,10 +7,16 @@
|
||||||
# to ~/.zshrc.
|
# to ~/.zshrc.
|
||||||
#
|
#
|
||||||
|
|
||||||
0="${(%):-%N}" # this gives immunity to functionargzero being unset
|
# According to the standard:
|
||||||
HSMW_REPO_DIR="${0%/*}"
|
# http://zdharma.org/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
|
||||||
if [[ -z "$ZPLG_CUR_PLUGIN" && "${fpath[(r)$HSMW_REPO_DIR]}" != $HSMW_REPO_DIR ]]; then
|
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
|
||||||
fpath+=( "$HSMW_REPO_DIR" )
|
0="${${(M)0:#/*}:-$PWD/$0}"
|
||||||
|
|
||||||
|
HSMW_REPO_DIR="${0:h}"
|
||||||
|
|
||||||
|
if [[ ${zsh_loaded_plugins[-1]} != */history-search-multi-word && -z ${fpath[(r)${0:h}]} ]]
|
||||||
|
then
|
||||||
|
fpath+=( "${0:h}" )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
autoload history-search-multi-word hsmw-context-main
|
autoload history-search-multi-word hsmw-context-main
|
||||||
|
|
Loading…
Reference in a new issue