From 31f67370ed0a02d873be9f73b98e7a36932662ac Mon Sep 17 00:00:00 2001 From: Aleksey Date: Thu, 18 Jan 2024 19:32:40 +0400 Subject: [PATCH] split global --- global.zsh | 51 +++----------------------------------- global/global_boot | 5 ++++ global/global_config_setup | 8 ++++++ global/global_configure | 4 +++ global/global_fpath_expand | 7 ++++++ global/global_path_expand | 7 ++++++ global/global_set_useropts | 4 +++ 7 files changed, 38 insertions(+), 48 deletions(-) create mode 100644 global/global_boot create mode 100644 global/global_config_setup create mode 100644 global/global_configure create mode 100644 global/global_fpath_expand create mode 100644 global/global_path_expand create mode 100644 global/global_set_useropts diff --git a/global.zsh b/global.zsh index adf3d98..0719b7a 100644 --- a/global.zsh +++ b/global.zsh @@ -13,51 +13,6 @@ if [[ -z $globaldots_path ]]; then echo 'functions require $globaldots_path to be set!' fi -# ZCONFIG - -## stuff for global dotfiles - -function global_path_expand() -{ - local bin_base=${globaldots_path}/bin - for pathnew in ${*}; do - zshlibs_path_add "${bin_base}/${pathnew}" - done; -} - -function global_fpath_expand() -{ - local bin_base=${globaldots_path}/bin - for pathnew in ${*}; do - zshlibs_fpath_add "${bin_base}/${pathnew}" - done; -} - -function global_set_useropts() -{ - typeset -a -g path_extra -} - -function global_configure() -{ - typeset -a -g path_extra -} - -function global_config_setup() -{ - zshlibs_log global "expanding path with '$path_extra'" - global_path_expand $path_extra - zshlibs_log global "expanding fpath with '$fpath_extra'" - global_fpath_expand vanilla - zshlibs_log global "done loading noninteractive config" -} - -function global_boot() -{ - global_configure - global_config_setup -} - -## normal functions - - +autoload global_path_expand global_fpath_expand global_set_useropts \ + global_configure global_config_setup global_boot +fpath+=(${zshlibs_install}/global) diff --git a/global/global_boot b/global/global_boot new file mode 100644 index 0000000..0c1d966 --- /dev/null +++ b/global/global_boot @@ -0,0 +1,5 @@ +function global_boot() +{ + global_configure + global_config_setup +} diff --git a/global/global_config_setup b/global/global_config_setup new file mode 100644 index 0000000..7ef4e62 --- /dev/null +++ b/global/global_config_setup @@ -0,0 +1,8 @@ +function global_config_setup() +{ + zshlibs_log global "expanding path with '$path_extra'" + global_path_expand $path_extra + zshlibs_log global "expanding fpath with '$fpath_extra'" + global_fpath_expand vanilla + zshlibs_log global "done loading noninteractive config" +} diff --git a/global/global_configure b/global/global_configure new file mode 100644 index 0000000..5958280 --- /dev/null +++ b/global/global_configure @@ -0,0 +1,4 @@ +function global_configure() +{ + typeset -a -g path_extra +} diff --git a/global/global_fpath_expand b/global/global_fpath_expand new file mode 100644 index 0000000..478f37f --- /dev/null +++ b/global/global_fpath_expand @@ -0,0 +1,7 @@ +function global_fpath_expand() +{ + local bin_base=${globaldots_path}/bin + for pathnew in ${*}; do + zshlibs_fpath_add "${bin_base}/${pathnew}" + done; +} diff --git a/global/global_path_expand b/global/global_path_expand new file mode 100644 index 0000000..ce57a57 --- /dev/null +++ b/global/global_path_expand @@ -0,0 +1,7 @@ +function global_path_expand() +{ + local bin_base=${globaldots_path}/bin + for pathnew in ${*}; do + zshlibs_path_add "${bin_base}/${pathnew}" + done; +} diff --git a/global/global_set_useropts b/global/global_set_useropts new file mode 100644 index 0000000..e2f99da --- /dev/null +++ b/global/global_set_useropts @@ -0,0 +1,4 @@ +function global_set_useropts() +{ + typeset -a -g path_extra +}