1212# And ensures that we have an obstruction-free .zshrc file
1313# This also ensures that the proper HyDE $ENVs are loaded
1414
15- function _load_common() {
16-
15+ function _load_functions() {
1716 # Load all custom function files // Directories are ignored
1817 for file in " ${ZDOTDIR:- $HOME / .config/ zsh} /functions/" * .zsh; do
1918 [ -r " $file " ] && source " $file "
2019 done
20+ }
2121
22+ function _load_completions() {
2223 for file in " ${ZDOTDIR:- $HOME / .config/ zsh} /completions/" * .zsh; do
2324 [ -r " $file " ] && source " $file "
2425 done
25-
2626}
2727
2828function _dedup_zsh_plugins {
@@ -53,8 +53,8 @@ function _defer_omz_after_prompt_before_input() {
5353 fpath=($ZDOTDIR /completions " ${fpath[@]} " )
5454
5555 _load_compinit
56-
57- _load_common
56+ _load_functions
57+ _load_completions
5858
5959 # zsh-autosuggestions won't work on first prompt when deferred
6060 if typeset -f _zsh_autosuggest_start > /dev/null; then
@@ -152,19 +152,18 @@ function _load_compinit() {
152152
153153function _load_prompt() {
154154 # Try to load prompts immediately
155- if ! source ${ZDOTDIR} /prompt.zsh > /dev/null 2>&1 ; then
155+ if ! source ${ZDOTDIR} /prompt.zsh > /dev/null 2>&1 ; then
156156 [[ -f $ZDOTDIR /conf.d/hyde/prompt.zsh ]] && source $ZDOTDIR /conf.d/hyde/prompt.zsh
157157 fi
158-
159158}
160159
161- # ? Override this environment variable in ~/.zshrc
160+ # Override this environment variable in ~/.zshrc
162161# cleaning up home folder
163162# ZSH Plugin Configuration
164163
165164HYDE_ZSH_DEFER=" 1" # Unset this variable in $ZDOTDIR/user.zsh to disable HyDE's deferred Zsh loading.
166165HYDE_ZSH_PROMPT=" 1" # Unset this variable in $ZDOTDIR/user.zsh to disable HyDE's prompt customization.
167- HYDE_ZSH_NO_PLUGINS=" 1 " # Unset this variable in $ZDOTDIR/user.zsh to disable HyDE's deferred Zsh loading.
166+ HYDE_ZSH_NO_PLUGINS=" 0 " # Set this variable to "1" in $ZDOTDIR/user.zsh to disable HyDE's Zsh plugin loading.
168167
169168ZSH_AUTOSUGGEST_STRATEGY=(history completion)
170169
191190
192191_load_compinit
193192
194- if [[ ${HYDE_ZSH_NO_PLUGINS} == " 1" ]]; then
193+
194+ if [[ ${HYDE_ZSH_NO_PLUGINS} != " 1" ]]; then
195195 # Deduplicate omz plugins()
196196 _dedup_zsh_plugins
197197
@@ -201,9 +201,16 @@ if [[ ${HYDE_ZSH_NO_PLUGINS} == "1" ]]; then
201201 else
202202 [[ -r $ZSH /oh-my-zsh.sh ]] && source $ZSH /oh-my-zsh.sh
203203 _load_prompt
204- _load_common
205-
204+ _load_functions
205+ _load_completions
206206 fi
207+ else
208+ _load_prompt
209+ _load_functions
210+ _load_completions
211+
212+ chmod +r $ZDOTDIR /.zshrc # Make sure .zshrc is readable
213+ [[ -r $ZDOTDIR /.zshrc ]] && source $ZDOTDIR /.zshrc
207214fi
208215
209216alias c=' clear' \
0 commit comments