function zconfig_checkload() { typeset -a -g zconfig_loaded if [[ ! ${zconfig_loaded[(r)${1}]} ]] then zshlibs_log zconfig "sourcing config '$1'" . -- $1 2>&1 >(zshlibs_log zconfig) zconfig_loaded+=("$1") zshlibs_log zconfig "end sourcing config '$1'" else zshlibs_log zconfig "config '$1' already loaded" zshlibs_log zconfig "currently loaded configs: ${zconfig_loaded}" fi }