File tree 1 file changed +5
-8
lines changed
1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -10,15 +10,13 @@ function abbr_fish --on-event fish_postexec -d "Abbreviation reminder for the cu
10
10
set -l command (string split ' ' " $argv " )
11
11
set -l cmd (string replace -r -a ' \\ s+' ' ' " $argv " )
12
12
13
- # Exit if either command is already an abbreviation
14
- # or not found
15
- # or it's a function
16
- if abbr -q " $cmd "
13
+ if test $_ abbr_tips_is_abbr = 1
14
+ set -g _abbr_tips_is_abbr 0
15
+ return
16
+ else if abbr -q " $cmd "
17
17
or ! type -q " $command [1]"
18
- or test $_ abbr_tips_is_abbr = 1
19
18
return
20
- end
21
- if test (type -t " $command [1]" ) = ' function'
19
+ else if test (type -t " $command [1]" ) = ' function'
22
20
and ! contains " $command [1]" $ABBR_TIPS_ALIAS_WHITELIST
23
21
return
24
22
end
@@ -32,7 +30,6 @@ function abbr_fish --on-event fish_postexec -d "Abbreviation reminder for the cu
32
30
or set -l abb (contains -i -- (string replace -r -a ' ((-{1,2})\\ w+)(\\ s\\ S+)' ' $1' " $cmd " ) $_ ABBR_TIPS_VALUES)
33
31
or set -l abb (contains -i -- (string replace -r -a ' (^( ?\\ w+){2}).*' ' $1' " $cmd " ) $_ ABBR_TIPS_VALUES)
34
32
or set -l abb (contains -i -- (string replace -r -a ' (^( ?\\ w+){3}).*' ' $1' " $cmd " ) $_ ABBR_TIPS_VALUES)
35
- set -g _abbr_tips_is_abbr 0
36
33
echo -e " \n💡 \e[1m$_ ABBR_TIPS_KEYS[$abb ]\e[0m => $_ ABBR_TIPS_VALUES[$abb ]"
37
34
return
38
35
end
You can’t perform that action at this time.
0 commit comments