run command when changing directories
Created by: aeosynth
fish functions can trigger when variables (eg PWD
) are changed; i use this to track my most used directories. shadowing cd
isn't enough, as that wouldn't trigger on implicit directory changing.
https://fishshell.com/docs/current/commands.html#function
-v or --on-variable VARIABLE_NAME tells fish to run this function when the variable VARIABLE_NAME changes value.