dotfiles/tag-zsh/zshrc
Oliver Davies e0c9014ec0 zsh: Enable extendedglob
Enable the extendedglob option, which is needed for the scripts in the
`configs/post` directory to load correctly.

This includes the completion script that is needed to fix #12 and #13.
2020-06-21 00:13:38 +01:00

38 lines
813 B
Bash

# Enable extended globbing for use in _load_settings()
setopt extendedglob
# extra files in ~/.zsh/configs/pre , ~/.zsh/configs , and ~/.zsh/configs/post
# these are loaded first, second, and third, respectively.
_load_settings() {
_dir="$1"
if [ -d "$_dir" ]; then
if [ -d "$_dir/pre" ]; then
for config in "$_dir"/pre/**/*~*.zwc(N-.); do
. $config
done
fi
for config in "$_dir"/**/*(N-.); do
case "$config" in
"$_dir"/(pre|post)/*|*.zwc)
:
;;
*)
. $config
;;
esac
done
if [ -d "$_dir/post" ]; then
for config in "$_dir"/post/**/*~*.zwc(N-.); do
. $config
done
fi
fi
}
_load_settings "$HOME/.zsh/configs"
# Local config
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local