diff --git a/ondir_prompt_hook.fish b/ondir_prompt_hook.fish new file mode 100644 index 0000000..28aa802 --- /dev/null +++ b/ondir_prompt_hook.fish @@ -0,0 +1,6 @@ +# copy this file to ~/.config/fish/functions +function ondir_prompt_hook --on-event fish_prompt + if test ! -e "$OLDONDIRWD"; set -g OLDONDIRWD /; end; + if [ "$OLDONDIRWD" != "$PWD" ]; eval (ondir $OLDONDIRWD $PWD); end; + set -g OLDONDIRWD "$PWD"; +end