gazorby / fish-abbreviation-tips

💡 Help you remembering your abbreviations
MIT License
291 stars 7 forks source link

Does not work for aliases defined inside fish scripts #30

Open vorburger opened 1 year ago

vorburger commented 1 year ago

Describe the bug

29 for #27 made abbr -a y ls -l && ls -l show :bulb: y => ls -l - thank you @gazorby!

It also DOES work for an alias (which is just a Fish function --wraps), as long as I type that alias on the prompt, for example this is great:

$ alias c="bat "
$ functions c
# Defined via `source`
function c --wraps='bat ' --description 'alias c=bat '
  bat  $argv

end

$ bat ~/.gitconfig
(...)
💡 c => bat

What I'm struggling with is to get this to work for aliases defined inside a Fish script....

To Reproduce

Steps to reproduce the behavior:

$ functions --erase c
$ echo 'alias c="bat "' >repro.fish
$ source repro.fish
$ functions c
# Defined via `source`
function c --wraps='bat ' --description 'alias c=bat '
  bat  $argv

end

$ bat repro.fish
(...)
# Does *NOT* print 💡 c => bat

Expected behavior

💡 c => bat

System (please complete the following information):