2013-03-15 07:37:33 +00:00
|
|
|
edit-command-line-tmux() {
|
|
|
|
local tmpfile=${TMPPREFIX:-/tmp/zsh}ecl$$
|
|
|
|
|
|
|
|
print -R - "$PREBUFFER$BUFFER" >$tmpfile
|
|
|
|
exec </dev/tty
|
2023-05-30 08:50:45 +00:00
|
|
|
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:t}") /dev/null
|
2013-03-15 07:37:33 +00:00
|
|
|
else
|
|
|
|
${=${VISUAL:-${EDITOR:-vi}}} $tmpfile
|
|
|
|
fi
|
|
|
|
print -Rz - "$(<$tmpfile)"
|
|
|
|
|
|
|
|
command rm -f $tmpfile
|
|
|
|
zle send-break # Force reload from the buffer stack
|
|
|
|
}
|