From a0706e0f4645888ade8672e9c9ddd864ee5c74bc Mon Sep 17 00:00:00 2001 From: Matt Hamilton Date: Wed, 30 Dec 2015 10:14:10 -0500 Subject: [PATCH] slight init refactor Removing argv removes the need to pass the arrays arround. Better to just reference them directly. --- init.zsh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/init.zsh b/init.zsh index a7de4d9..e5b1734 100755 --- a/init.zsh +++ b/init.zsh @@ -27,7 +27,7 @@ load_zim_function() { local mod_function # autoload searches fpath for function locations; add enabled module function paths - fpath=(${argv:+${ZIM}/modules/${^zmodules}/functions(/FN)} ${fpath}) + fpath=(${${zmodules}:+${ZIM}/modules/${^zmodules}/functions(/FN)} ${fpath}) function { setopt LOCAL_OPTIONS EXTENDED_GLOB @@ -38,11 +38,9 @@ load_zim_function() { } } -# Load zim functions -load_zim_function ${zmodules[@]} - -# Load zim modules -load_zim_module ${zmodules[@]} +# initialize zim modules +load_zim_function +load_zim_module unset zmodules unfunction load_zim_{module,function}