added yazi function and keybind
This commit is contained in:
parent
862f5d119b
commit
65c7594d29
1 changed files with 14 additions and 0 deletions
|
@ -41,6 +41,20 @@ function runranger() {
|
||||||
zle -N runranger
|
zle -N runranger
|
||||||
bindkey '^f' 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() {
|
function ss() {
|
||||||
command grc --colour=auto ss "$@"
|
command grc --colour=auto ss "$@"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue