Skip to content

Commit 42a0d73

Browse files
committed
Added custom prompt and some potential fix
Closes #903 Closes #896
1 parent b422aad commit 42a0d73

File tree

2 files changed

+40
-21
lines changed

2 files changed

+40
-21
lines changed

Configs/.config/zsh/conf.d/hyde/terminal.zsh

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414

1515
function _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.
155159
HYDE_ZSH_NO_PLUGINS="1" #Unset this variable in $ZDOTDIR/user.zsh to disable HyDE's deferred Zsh loading.
156160

157161
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
@@ -177,8 +181,12 @@ elif [[ -f $ZDOTDIR/user.zsh ]]; then
177181
source $ZDOTDIR/user.zsh
178182
fi
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

183191
if [[ ${HYDE_ZSH_NO_PLUGINS} == "1" ]]; then
184192
# Deduplicate omz plugins()

Configs/.config/zsh/prompt.zsh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Add you own custom prompt here
2+
3+
return 1 # TODO <--- Uncomment this line to disable HyDE's prompt
4+
#! As long as this file returns non-zero, HyDE will ignore this file!
5+
6+
# ================================================================
7+
# Your custom prompt goes here
8+
9+
# eval "$(starship init zsh)"
10+
# export STARSHIP_CACHE=$XDG_CACHE_HOME/starship
11+
# export STARSHIP_CONFIG=$XDG_CONFIG_HOME/starship/starship.toml

0 commit comments

Comments
 (0)