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

Re: backward-kill-shell-word widget



On Jan 10,  7:53pm, Daniel Shahaf wrote:
}
} Bart Schaefer wrote on Sun, Jan 10, 2016 at 09:17:44 -0800:
} > 
} >     backward-kill-shell-word() {
} >       zle select-in-shell-word
} >       ((++CURSOR))  # adjust for vi vs. emacs region
} >       zle kill-region
} 
} I'd add:
}         LBUFFER+=" "
} 
} Without that, LBUFFER[-1] after the widget is the last character of the
} preceding word.

If you don't kill the space, select-in-shell-word won't identify the
correct word on a repeated call.

Other problems I've noted with this approach are that multiple calls
add to the kill ring but do not append to CUTBUFFER, and that this
kills the whole word under the cursor not just the part to the left.

So it needs some work.



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