From f1fc581fa5df58425db20758bcd555fa8fd56037 Mon Sep 17 00:00:00 2001 From: Mark Engel Date: Thu, 10 Oct 2013 10:54:35 +0200 Subject: [PATCH] add ondir prompt hook function for fish shell --- ondir_prompt_hook.fish | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ondir_prompt_hook.fish 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