diff --git a/.config/fish/functions/y.fish b/.config/fish/functions/y.fish new file mode 100644 index 0000000..3e2af95 --- /dev/null +++ b/.config/fish/functions/y.fish @@ -0,0 +1,8 @@ +function y + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + builtin cd -- "$cwd" + end + rm -f -- "$tmp" +end