yazi: init

This commit is contained in:
Nico 2026-01-05 02:15:30 +11:00
parent 50d8845e06
commit 3ac3a823d1
Signed by: nico
SSH key fingerprint: SHA256:XuacYOrGqRxC3jVFjfLROn1CSvLz85Dec6N7O9Gwu/0
4 changed files with 73 additions and 0 deletions

View file

@ -109,3 +109,11 @@ plugInstall https://github.com/Aloxaf/fzf-tab fzf-tab.zsh
# load fzf and zoxide
eval "$(fzf --zsh)"
eval "$(zoxide init zsh)"
function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
command yazi "$@" --cwd-file="$tmp"
IFS= read -r -d '' cwd < "$tmp"
[ -n "$cwd" ] && [ "$cwd" != "$PWD" ] && builtin cd -- "$cwd"
command rm -f -- "$tmp"
}