1414
1515function _load_common() {
1616
17- for file in " ${ZDOTDIR:- $HOME / .config/ zsh} /completions/" * .zsh; do
17+ # Load all custom function files // Directories are ignored
18+ for file in " ${ZDOTDIR:- $HOME / .config/ zsh} /functions/" * .zsh; do
1819 [ -r " $file " ] && source " $file "
1920 done
2021
21- # Load all custom function files // Directories are ignored
22- for file in " ${ZDOTDIR:- $HOME / .config/ zsh} /functions/" * .zsh; do
22+ for file in " ${ZDOTDIR:- $HOME / .config/ zsh} /completions/" * .zsh; do
2323 [ -r " $file " ] && source " $file "
2424 done
2525
@@ -52,20 +52,7 @@ function _defer_omz_after_prompt_before_input() {
5252 # Add your completions directory to fpath
5353 fpath=($ZDOTDIR /completions " ${fpath[@]} " )
5454
55- # Initialize completions with optimized performance
56- autoload -Uz compinit
57-
58- # Enable extended glob for the qualifier to work
59- setopt EXTENDED_GLOB
60-
61- # Fastest - use glob qualifiers on directory pattern
62- if [[ -n ${ZDOTDIR} /.zcompdump(# qN.mh+${HYDE_ZSH_COMPINIT_CHECK:-1}) ]]; then
63- compinit
64- else
65- compinit -C
66- fi
67-
68- _comp_options+=(globdots) # tab complete hidden files
55+ _load_compinit
6956
7057 _load_common
7158
@@ -146,12 +133,29 @@ function do_render {
146133 esac
147134}
148135
136+ function _load_compinit() {
137+ # Initialize completions with optimized performance
138+ autoload -Uz compinit
139+
140+ # Enable extended glob for the qualifier to work
141+ setopt EXTENDED_GLOB
142+
143+ # Fastest - use glob qualifiers on directory pattern
144+ if [[ -n ${ZDOTDIR} /.zcompdump(# qN.mh+${HYDE_ZSH_COMPINIT_CHECK:-1}) ]]; then
145+ compinit
146+ else
147+ compinit -C
148+ fi
149+
150+ _comp_options+=(globdots) # tab complete hidden files
151+ }
152+
149153# ? Override this environment variable in ~/.zshrc
150154# cleaning up home folder
151155# ZSH Plugin Configuration
152156
153- HYDE_ZSH_DEFER=" 1" # Unset this variable in $ZDOTDIR/user.zsh to disable HyDE's deferred Zsh loading.
154- HYDE_ZSH_PROMPT=" 1" # Unset this variable in $ZDOTDIR/user.zsh to disable HyDE's prompt customization.
157+ HYDE_ZSH_DEFER=" 1" # Unset this variable in $ZDOTDIR/user.zsh to disable HyDE's deferred Zsh loading.
158+ HYDE_ZSH_PROMPT=" 1" # Unset this variable in $ZDOTDIR/user.zsh to disable HyDE's prompt customization.
155159HYDE_ZSH_NO_PLUGINS=" 1" # Unset this variable in $ZDOTDIR/user.zsh to disable HyDE's deferred Zsh loading.
156160
157161ZSH_AUTOSUGGEST_STRATEGY=(history completion)
@@ -177,8 +181,12 @@ elif [[ -f $ZDOTDIR/user.zsh ]]; then
177181 source $ZDOTDIR /user.zsh
178182fi
179183
180- # Try to load prompts immediately
181- [[ -f $ZDOTDIR /conf.d/hyde/prompt.zsh ]] && source $ZDOTDIR /conf.d/hyde/prompt.zsh
184+ _load_compinit
185+
186+ # Try to load prompts immediately
187+ if ! source ${ZDOTDIR} /prompt.zsh; then
188+ [[ -f $ZDOTDIR /conf.d/hyde/prompt.zsh ]] && source $ZDOTDIR /conf.d/hyde/prompt.zsh
189+ fi
182190
183191if [[ ${HYDE_ZSH_NO_PLUGINS} == " 1" ]]; then
184192 # Deduplicate omz plugins()
0 commit comments