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

Re: backward kill

Mads Martin Joergensen wrote:
> * Peter Stephenson <pws@xxxxxxx> [Nov 15. 2001 16:22]:
> > > with the prompt at the end, and I press alt-backspace, the whole path is
> > > wiped out. I would like it to just remove backwards to the last (first
> > > from the end) slash. How could I accomplish this?
> > 
> > Use the bash-backward-kill-word widget, supplied with 4.0 and 4.1.  (The
> > other bash-* variants are only supplied with 4.1).
> Cannot seem to get that working, and the manpage mentions nothing
> about it?

It's documented in zshcontrib(1), but only in 4.1.  I think I'll copy the
remainder of the bash-* stuff to the 4.0 branch.

The file tells you what to do.  Make sure the directory is in your autoload
path --- zsh should have been set up so that it is --- and autoload it like
any other function.

# This implements a bash-style backward-kill-word.
# To use,
#   zle -N bash-backward-kill-word
#   bindkey '...' bash-backward-kill-word
# or if you wish to replace existing backward-kill-word bindings,
#   zle -N backward-kill-word bash-backward-kill-word

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070

The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
If you received this in error, please contact the sender and 
delete the material from any computer.

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