feat(fish): yazi wrapper for exiting on the current dir

This commit is contained in:
Sergio Laín 2023-12-07 14:07:34 +01:00
parent 1ee0f0e664
commit fb9af295e0
No known key found for this signature in database
GPG key ID: 14C9B8080681777B

View file

@ -1,4 +1,8 @@
function fe --wraps=yazi --description 'alias fe=yazi'
yazi $argv
function fe
set tmp (mktemp -t "yazi-cwd.XXXXX")
yazi --cwd-file="$tmp"
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
cd -- "$cwd"
end
rm -f -- "$tmp"
end