2011-09-13 11:26:35 -07:00
|
|
|
# Eryn Wells <eryn@erynwells.me>
|
|
|
|
|
2018-04-14 09:41:42 -07:00
|
|
|
# Don't read global startup. It messes things up...
|
|
|
|
unsetopt GLOBAL_RCS
|
|
|
|
|
2021-12-31 10:27:27 -08:00
|
|
|
export SYS=`uname -s | tr A-Z a-z`
|
2012-04-10 10:11:14 -07:00
|
|
|
|
2024-09-24 12:55:43 -07:00
|
|
|
function init-env-fpath
|
|
|
|
{
|
2024-09-26 10:06:20 -07:00
|
|
|
local -r fpath_candidates=( \
|
|
|
|
"$HOME/.zsh/${SYS}-functions" \
|
|
|
|
"$HOME/.zsh/func" \
|
|
|
|
)
|
|
|
|
|
|
|
|
# Process the array in reverse order (`Oa` means "descending index order",
|
|
|
|
# in other worse "reverse order"; see PARAMETER EXPANSION section of the man
|
|
|
|
# pages) so the paths are prepended in the correct order.
|
|
|
|
for candidate in ${(Oa)fpath_candidates}; do
|
|
|
|
if [[ ! -d "$candidate" ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
fpath=($candidate $fpath)
|
|
|
|
done
|
2023-03-27 10:37:08 -07:00
|
|
|
}
|
|
|
|
|
2024-09-24 12:55:43 -07:00
|
|
|
init-env-fpath
|
2022-05-25 14:06:52 -07:00
|
|
|
|
|
|
|
autoload -Uz do_init_functions
|
|
|
|
|
|
|
|
typeset -a zsh_init_env_functions=( \
|
2024-09-26 16:05:49 -07:00
|
|
|
init-env \
|
2024-09-24 09:25:09 -07:00
|
|
|
init-env-path \
|
2024-09-26 16:19:28 -07:00
|
|
|
init-env-tilde-paths \
|
2024-09-24 09:17:45 -07:00
|
|
|
init-env-python \
|
|
|
|
init-env-playdate \
|
2024-09-24 09:25:09 -07:00
|
|
|
init-env-vi \
|
|
|
|
init-env-$SYS \
|
2022-05-25 14:06:52 -07:00
|
|
|
)
|
2021-12-31 10:27:27 -08:00
|
|
|
|
2022-05-25 14:06:52 -07:00
|
|
|
do_init_functions zsh_init_env_functions
|