diff --git a/omz.plugin.zsh b/omz.plugin.zsh new file mode 100644 index 0000000..6271c4d --- /dev/null +++ b/omz.plugin.zsh @@ -0,0 +1,26 @@ +#! /bin/zsh + +ZLUA_SCRIPT="${0:A:h}/z.lua" + +[[ -n "$ZLUA_EXEC" ]] && [[ ! -x "$ZLUA_EXEC" ]] && ZLUA_EXEC="" + +# search lua executable +if [[ -z "$ZLUA_EXEC" ]]; then + if [[ -x "$(which lua)" ]]; then + ZLUA_EXEC="$(which lua)" + elif [[ -x "$(which lua5.3)" ]]; then + ZLUA_EXEC="$(which lua5.3)" + elif [[ -x "$(which lua5.2)" ]]; then + ZLUA_EXEC="$(which lua5.2)" + elif [[ -x "$(which lua5.1)" ]]; then + ZLUA_EXEC="$(which lua5.1)" + else + echo "Not find lua in your $PATH, please install it." + return + fi +fi + + +eval "$($ZLUA_EXEC $ZLUA_SCRIPT --init zsh once enhanced)" + +