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

Re: line continuation with sed



add-zle-hook-widget                                    
zsh: command not found: add-zle-hook-widget

locate add-zle-hook-widget
/usr/local/share/zsh/5.8/functions/_add-zle-hook-widget
/usr/local/share/zsh/5.8/functions/_add-zle-hook-widget.zwc
/usr/local/share/zsh/5.8/functions/add-zle-hook-widget
/usr/local/share/zsh/5.8/functions/add-zle-hook-widget.zwc

echo $fpath
/root/scripts//zsh/functions/zle/  /usr/local/share/zsh/5.8/functions/

why the command is not found? Should I do something to load the functions from fpath?
thanks

Pier Paolo Grassi


Il giorno lun 17 ott 2022 alle ore 06:22 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> ha scritto:
On Sun, Oct 16, 2022 at 8:40 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> On 2022-10-16 18:07, Bart Schaefer wrote:
> > You might find something like this interesting:
> That is really elegant.

Actually that implementation is kind of ugly.  I completely forgot
about this much prettier way:

show-trailing-space() {
  if [[ $BUFFER = *(' '|$' \n'*)
        || $PREBUFFER = *$' \n'* ]]
  then POSTDISPLAY=$'\u21a9'
  else unset POSTDISPLAY
  fi
}
zle -N show-trailing-space
add-zle-hook-widget line-pre-redraw show-trailing-space
add-zle-hook-widget history-line-set show-trailing-space



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