Increase yazi functionality in helix

This commit is contained in:
Ceres 2025-11-25 15:24:11 +00:00
parent 85b60eb42f
commit 2fd21c8c6a
Signed by: ceres-sees-all
GPG key ID: 9814758436430045
2 changed files with 12 additions and 1 deletions

View file

@ -49,5 +49,14 @@ if status is-interactive
echo -en "\e]133;A\e\\"
end
function y
set tmp (mktemp -t "yazi-cwd.XXXXXX")
yazi $argv --cwd-file="$tmp"
if read -z cwd <"$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
builtin cd -- "$cwd"
end
rm -f -- "$tmp"
end
bind \cz 'fg 2>/dev/null; commandline -f repaint'
end

View file

@ -6,9 +6,11 @@ render = true
[keys.normal.space]
e = [
':sh rm -f /tmp/unique-file',
':insert-output yazi %{buffer_name} --chooser-file=/tmp/unique-file',
':sh rm -f /tmp/unique-cwd-file',
":insert-output yazi --chooser-file=/tmp/unique-file --cwd-file=/tmp/unique-cwd-file",
':insert-output echo "\x1b[?1049h\x1b[?2004h" > /dev/tty',
':open %sh{cat /tmp/unique-file}',
':cd %sh{cat /tmp/unique-cwd-file}',
':redraw',
]