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

Re: ctrl w behaviour: jump in front of separating characters?



On Wed, Aug 25, 2021 at 11:43 AM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> Bart Schaefer wrote on Tue, 24 Aug 2021 22:32 +00:00:
> > Writing your own widget:
> >
> > backward-kill-word-space() {
> >   backward-kill-word-match
>
> This should have read «zle backward-kill-word-match».

Actually that isn't necessary, backward-kill-word-match can be run as
a function as long as it is in the context of another widget, it
doesn't have to be run as a widget on its own.

> >   while [[ $LBUFFER = *' ' ]] &&
> >     zle backward-delete-char
>
> Curious: Any particular reason to prefer this over «LBUFFER=${LBUFFER% }»?

I didn't confirm, but I believe the latter doesn't include the space
in the undo list and kill ring?




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