mirror of
https://github.com/Lissy93/dotfiles.git
synced 2025-02-17 23:30:47 +01:00
🤓 Adds hook to display alias tips for long commands
This commit is contained in:
parent
3e5bf34d6d
commit
e2fc1690c8
14
zsh/aliases/alias-tips.zsh
Normal file
14
zsh/aliases/alias-tips.zsh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
# If an alias for the command just run exists, then show tip
|
||||||
|
preexec_alias-finder() {
|
||||||
|
tip=$(alias | grep -E "=$1$")
|
||||||
|
if [ ! -z "$tip" ]; then
|
||||||
|
echo -e "\033[0;90m\e[3mTip: \e[4m$tip\033[0m"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Load add-zsh-hook
|
||||||
|
autoload -U add-zsh-hook
|
||||||
|
|
||||||
|
# Call function after command
|
||||||
|
add-zsh-hook preexec preexec_alias-finder
|
Loading…
Reference in New Issue
Block a user