1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00
zsh/Functions/Zle/move-line-in-buffer

16 lines
424 B
Text

#autoload
# Line motions that do not leave the current history entry,
# for editing in multi-line buffers.
# To use:
# autoload -Uz move-line-in-buffer
# zle -N up-line-in-buffer move-line-in-buffer
# zle -N down-line-in-buffer move-line-in-buffer
#
# then bindkey as you prefer
local hno=$HISTNO curs=$CURSOR
zle .${WIDGET:s/in-buffer/or-history} "$@" &&
(( HISTNO != hno && (HISTNO=hno, CURSOR=curs) ))
return 0