File tree 1 file changed +12
-10
lines changed 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 12
12
# export ZSH_PLUGINS_ALIAS_TIPS_EXPAND=0
13
13
14
14
_alias_tips__preexec () {
15
- if [[ $1 != $2 ]] then # Alias is used
16
- if [[ ${ZSH_PLUGINS_ALIAS_TIPS_REVEAL-0} == 1 ]] then # Reveal aliased command
17
- if [[ ${${ZSH_PLUGINS_ALIAS_TIPS_REVEAL_EXCLUDES- ()}[(I)$1 ]} ! = 0 ]] then # Exit
18
- return 0
19
- fi
20
- local reveal_text= ${ZSH_PLUGINS_ALIAS_TIPS_REVEAL_TEXT-${ZSH_PLUGINS_ALIAS_TIPS_TEXT-Alias tip: } }
21
- local color_dark_gray= ' \e[1;30m'
22
- local color_reset= ' \e[0m'
23
- echo -e " $color_dark_gray$reveal_text $2 $color_reset "
15
+ local CMD=$1
16
+ local CMD_EXPANDED=$2
17
+ if [[ $CMD != $CMD_EXPANDED ]] then # Alias is used
18
+ if [[ ${ZSH_PLUGINS_ALIAS_TIPS_REVEAL-0} == 1 ]] \
19
+ && [[ ${${ZSH_PLUGINS_ALIAS_TIPS_REVEAL_EXCLUDES- ()}[(I)$1 ]} == 0 ]] then # Reveal cmd
20
+ local reveal_text= ${ZSH_PLUGINS_ALIAS_TIPS_REVEAL_TEXT-Alias for: }
21
+ local color_dark_gray= ' \e[1;30m'
22
+ local color_reset= ' \e[0m'
23
+ echo -e " $color_dark_gray$reveal_text$CMD_EXPANDED $color_reset "
24
+ fi
25
+ if [[ ${ZSH_PLUGINS_ALIAS_TIPS_EXPAND-1} == 0 ]] then
26
+ return 0
24
27
fi
25
- return 0
26
28
fi
27
29
28
30
if hash git 2> /dev/null; then
You can’t perform that action at this time.
0 commit comments