feat: y function to preserve navigation from yazi
This commit is contained in:
1 parent
222191485a
commit
8685ff0c51
1 file changed
+8
@@ -136,3 +136,11 @@ done
|
|||||||
alias arty="arty.sh"
|
alias arty="arty.sh"
|
||||||
alias stacks="stacks.sh"
|
alias stacks="stacks.sh"
|
||||||
type bat >/dev/null 2>&1 && alias cat="bat --paging=never"
|
type bat >/dev/null 2>&1 && alias cat="bat --paging=never"
|
||||||
|
|
||||||
|
function y() {
|
||||||
|
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
|
||||||
|
command yazi "$@" --cwd-file="$tmp"
|
||||||
|
IFS= read -r -d '' cwd < "$tmp"
|
||||||
|
[ "$cwd" != "$PWD" ] && [ -d "$cwd" ] && builtin cd -- "$cwd"
|
||||||
|
command rm -f -- "$tmp"
|
||||||
|
}
|
||||||
Reference in new issue
Block a user