Fix alias tips

This commit is contained in:
Alicia Sykes 2022-10-31 17:20:41 +00:00
parent bcd2ab8182
commit a57a8b2721
2 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ source ${zsh_dir}/aliases/general.zsh
source ${zsh_dir}/aliases/git.zsh
source ${zsh_dir}/aliases/node-js.zsh
source ${zsh_dir}/aliases/flutter.zsh
# source ${zsh_dir}/aliases/alias-tips.zsh
source ${zsh_dir}/aliases/alias-tips.zsh
# Setup Antigen, and import plugins
source ${zsh_dir}/helpers/setup-antigen.zsh

View File

@ -1,9 +1,9 @@
# If an alias for the command just run exists, then show tip
preexec_alias-finder() {
tip=$(alias | grep -E "=$1$")
tip=$(alias | grep -E "=$1$" | head -1)
if [ ! -z "$tip" ]; then
echo -e "\033[0;90m\e[3mTip: \e[4m$tip\033[0m"
echo -e "\033[0;90m\e[3mAlias Tip: \e[4m$tip\033[0m"
fi
}
@ -11,4 +11,4 @@ preexec_alias-finder() {
autoload -U add-zsh-hook
# Call function after command
add-zsh-hook preexec preexec_alias-finder
add-zsh-hook preexec preexec_alias-finder