feat: y function to preserve navigation from yazi
This commit is contained in:
@@ -136,3 +136,11 @@ done
|
||||
alias arty="arty.sh"
|
||||
alias stacks="stacks.sh"
|
||||
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