diff --git a/etc/lf.fish b/etc/lf.fish new file mode 100644 index 0000000..8459000 --- /dev/null +++ b/etc/lf.fish @@ -0,0 +1,18 @@ +# Change working dir in Fish to last dir in lf on exit (adapted from Bash version) +# +# You need to copy the content of this file to ~/.config/fish/config.fish +# + +function lf + set tmp (mktemp) + command lf -last-dir-path=$tmp $argv + if test -f "$tmp" + set dir (cat $tmp) + if test -n "$dir" + if test "$dir" != (pwd) + cd $dir + end + end + end + rm -f $tmp +end