Is it possible to have fish automatically load additional configurations based on the directory you are in? A possible example, but obviously this doesn't work. You navigate to a project folder:
cd ~/my_proj
There is a file in that folder called .fish.config that contains a special fish function that is now accessible (since we are in my_proj).
Is there any built-in mechanism in fish that allows the loading from some fish config file when navigating to a directory (similar to above)?
Take a look at the --on-variable flag for the function statement. You can define a function like this that runs whenever the PWD changes:
function react_to_pwd --on-variable PWD
echo Reacting to PWD changing to $PWD
end
There is some pre-existing work in this area:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With