jorgebucaran / fisher

A plugin manager for Fish
https://git.io/fisher
MIT License
7.53k stars 257 forks source link

Plugin with user function does not load on start #773

Closed kuncevic closed 10 months ago

kuncevic commented 10 months ago

Just notice that my custom plugin with user function doesn't load on terminal start unless I run any random meaningful command in terminal.

I've looked into this one https://github.com/jorgebucaran/fisher/issues/462 but could not figure out the cause

I've installed fish and fisher using brew

My env:

fisher: version 4.4.4 fish: version 3.6.1 macos 13.4.1

la ~/.config/fisher
ls: /Users/xyz/.config/fisher: No such file or directory
 la ~/.config/fish/fish_plugins
-rw-r--r--@ 1 A  staff   194B 26 Aug 11:48 /Users/xyz/.config/fish/fish_plugins
cat ~/.config/fish/fish_plugins 
andreiborisov/sponge
franciscolourenco/done
joseluisq/gitnow
jorgebucaran/autopair.fish
gazorby/fish-abbreviation-tips
lewisacidic/fish-git-abbr
jabirali/fish-abbrfile
kuncevic/execute-dir.fish
echo $HOME
/Users/xyz

All above return empty

echo $XDG_CONFIG_HOME
echo $fisher_config
echo $fisher_cache
echo $fisher_path
kuncevic commented 10 months ago

Just noticed may be related to this one https://github.com/fish-shell/fish-shell/issues/5176

jorgebucaran commented 10 months ago

The issue might be due to a mismatch between the function name and the file name. If your function is called xd, then the file should also be named xd.fish, not execute_dir.fish.

FYI, I don't support the brew installation. It shouldn't exist. Stick to the installation steps in the README. 🙏

kuncevic commented 10 months ago

@jorgebucaran oh, really, I didn't know that func name should be equal to file name. Is it documented anywhere?

jorgebucaran commented 10 months ago

This isn't a Fisher thing; it's Fish.

Fish automatically looks for a function when you try to run a command, searching in ~/.config/fish/functions. So, if you want a function called foo, you create a file named foo.fish in that directory.

kuncevic commented 10 months ago

@jorgebucaran yeah I understand, thanks for point that out. Problem solved!