2023-08-21 09:53:57 +00:00
|
|
|
local tmpfile=${TMPPREFIX:-/tmp/zsh}ecl$$
|
2013-03-15 07:37:33 +00:00
|
|
|
|
2023-08-21 09:53:57 +00:00
|
|
|
print -R - "$PREBUFFER$BUFFER" >$tmpfile
|
|
|
|
exec </dev/tty
|
|
|
|
if [[ $KITTY_WINDOW_ID ]]; then
|
|
|
|
kitty @launch --type overlay vim -c 'set laststatus=0 showtabline=0 ft=zsh' $tmpfile
|
|
|
|
tail -f --pid=$(pgrep -f "vim.*${tmpfile}") /dev/null &> /dev/null
|
|
|
|
else
|
|
|
|
${=${VISUAL:-${EDITOR:-vi}}} $tmpfile
|
|
|
|
fi
|
|
|
|
print -Rz - "$(<$tmpfile)"
|
2013-03-15 07:37:33 +00:00
|
|
|
|
2023-08-21 09:53:57 +00:00
|
|
|
command rm -f $tmpfile
|
|
|
|
zle send-break # Force reload from the buffer stack
|
|
|
|
|
|
|
|
# vim:ft=zsh
|