added yazi function and keybind

This commit is contained in:
eeleater 2024-11-26 01:48:51 +01:00
parent 862f5d119b
commit 65c7594d29

View file

@ -41,6 +41,20 @@ function runranger() {
zle -N runranger
bindkey '^f' runranger
function yy() {
if [ -n "$YAZI_LEVEL" ]; then
exit
fi
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
cd -- "$cwd"
fi
rm -f -- "$tmp"
}
bindkey -s "^y" "yy\n"
function ss() {
command grc --colour=auto ss "$@"
}