Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: line continuation with sed




On 2022-10-16 18:07, Bart Schaefer wrote:
You might find something like this interesting:

show-trailing-space() {
   zle .$WIDGET &&
   if [[ $BUFFER = *(' '|$' \n'*)
         || $PREBUFFER = *$' \n'* ]]
   then POSTDISPLAY=$'\u21a9'
   else unset POSTDISPLAY
   fi
}
zle -N magic-space show-trailing-space
zle -N self-insert show-trailing-space
zle -N kill-whole-line show-trailing-space
zle -N kill-line show-trailing-space
zle -N kill-word show-trailing-space
zle -N backward-kill-word show-trailing-space
zle -N backward-delete-char show-trailing-space

Integrating this with other plugins etc. that may have rebound those
widgets or appropriated POSTDISPLAY is left as an exercise.  Other
improvements (bind to history motions etc.) are possible.

That is really elegant.  Too bad I can't have that in my editor, that little 'return' graphic is exactly what I'd like




Messages sorted by: Reverse Date, Date, Thread, Author