X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=ax.zsh;h=56379dcd2a43aafa4fde80ac9d8d803e8a1cf6b0;hb=b657444e40992ebe8c0a1a698e1a1bad27324313;hp=eafae555501cf816ee6ef509258af8588d77a218;hpb=fe5b9ab11df59cfc69a7b06e591dc09ec6c4c1f7;p=ax-zsh.git diff --git a/ax.zsh b/ax.zsh index eafae55..56379dc 100644 --- a/ax.zsh +++ b/ax.zsh @@ -1,6 +1,11 @@ # AX-ZSH: Alex' Modular ZSH Configuration # Copyright (c) 2015 Alexander Barton +script_name="$(basename -- "${(%):-%N}")" +script_type="$script_name[2,-1]" + +[[ -f "$HOME/.axzsh.debug" ]] && echo "» $script_name:" + # Load plugin code of a given type. # - $1: plugin name # - $2: plugin type (optional; defaults to "zshrc") @@ -36,15 +41,24 @@ function axzsh_load_plugin { fi return 0 done - [[ -f "$HOME/.axzsh.debug" ]] \ - && echo "Plugin \"$plugin\" not found (type \"$type\")!" >/dev/stderr + # Plugin not found! + if [[ -f "$HOME/.axzsh.debug" ]]; then + # Show error message for all stages in "debug mode": + echo "AX-ZSH plugin \"$plugin\" not found (type \"$type\")!" >&2 + elif [[ "$type" == "zshrc" ]]; then + # Show error message for the "zshrc" stage: + echo "AX-ZSH plugin \"$plugin\" not found, skipped!" >&2 + fi return 1 } # Make sure that "AXZSH" variable is set and exported if [[ -z "$AXZSH" ]]; then export AXZSH="$HOME/.axzsh" - [[ -f "$HOME/.axzsh.debug" ]] && echo "AXZSH=$AXZSH" + if [[ -f "$HOME/.axzsh.debug" ]]; then + echo "AXZSH=$AXZSH" + echo "AXZSH_PLUGIN_D=$AXZSH_PLUGIN_D" + fi fi # Setup list of default plugins if not set already. This allows users to @@ -55,13 +69,12 @@ if ! typeset +m axzsh_default_plugins | fgrep array >/dev/null 2>&1; then byebye completion correction - git history - homebrew ls prompt ssh std_aliases + std_env ) fi @@ -76,9 +89,6 @@ plugin_list=( ) # Read in all the plugins for the current "type": -script_name="$(basename -- "${(%):-%N}")" -script_type="$script_name[2,-1]" -[[ -f "$HOME/.axzsh.debug" ]] && echo "» $script_name:" for plugin ($plugin_list); do axzsh_load_plugin "$(basename "$plugin")" "$script_type" done