zsh-users
 help / color / mirror / code / Atom feed
* backward kill
@ 2001-11-15 15:02 Jesper Holmberg
  0 siblings, 0 replies; 8+ messages in thread
From: Jesper Holmberg @ 2001-11-15 15:02 UTC (permalink / raw)
  To: Zsh-users List

[-- Attachment #1: Type: text/plain, Size: 487 bytes --]

Hi all,

I am using the emacs key bindings. If I've written the following:

/path/to/some/file

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?

TIA

Jesper

-- 
          Jesper Holmberg            |"But how can |
  jesper.holmberg@enst-bretagne.fr   | one be warm |
ENST Br, BP 832, 29285 Brest, FRANCE | alone?"     |


[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: backward kill
  2001-11-15 17:01 ` Will Yardley
@ 2001-11-15 18:43   ` Jesper Holmberg
  0 siblings, 0 replies; 8+ messages in thread
From: Jesper Holmberg @ 2001-11-15 18:43 UTC (permalink / raw)
  To: Zsh-users List


* On Thu Nov 15, Will Yardley wrote:
> i think that's what you're looking for, no?

Yes, thanks. This seems perfect.

Jesper

-- 
          Jesper Holmberg            |"But how can |
  jesper.holmberg@enst-bretagne.fr   | one be warm |
ENST Br, BP 832, 29285 Brest, FRANCE | alone?"     |


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: backward kill
  2001-11-15 15:05 Jesper Holmberg
  2001-11-15 15:21 ` Peter Stephenson
@ 2001-11-15 17:01 ` Will Yardley
  2001-11-15 18:43   ` Jesper Holmberg
  1 sibling, 1 reply; 8+ messages in thread
From: Will Yardley @ 2001-11-15 17:01 UTC (permalink / raw)
  To: Zsh-users List

Jesper Holmberg wrote:
> Hi all,
> 
> I am using the emacs key bindings. If I've written the following:
> 
> /path/to/some/file
 
> 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?

i use this bit contributed by someone on the list (Oliver Kiddle); check
the archives from Mon, Oct. 8 for more info on this:

tcsh-backward-delete-word () {
  local WORDCHARS="${WORDCHARS:s#/#}"
  zle backward-delete-word
}

i have it bound to control-W with:
bindkey '^W' tcsh-backward-delete-word

but you can change that obviously.

i think that's what you're looking for, no?

the '$WORDCHARS' variable is how zsh determines word boundaries so you
could add '/' to that globally, however this might affect other things
you want to leave it for, so i prefer this function.

w

-- 
GPG Public Key:
http://infinitejazz.net/will/pgp/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: backward kill
  2001-11-15 15:34   ` Mads Martin Joergensen
  2001-11-15 15:40     ` Peter Stephenson
@ 2001-11-15 15:46     ` Jesper Holmberg
  1 sibling, 0 replies; 8+ messages in thread
From: Jesper Holmberg @ 2001-11-15 15:46 UTC (permalink / raw)
  To: Zsh users list


* On Thu Nov 15, Mads Martin Joergensen wrote:
> Cannot seem to get that working, and the manpage mentions nothing
> about it?

Same problems here.

Jesper

-- 
          Jesper Holmberg            |"But how can |
  jesper.holmberg@enst-bretagne.fr   | one be warm |
ENST Br, BP 832, 29285 Brest, FRANCE | alone?"     |


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: backward kill
  2001-11-15 15:34   ` Mads Martin Joergensen
@ 2001-11-15 15:40     ` Peter Stephenson
  2001-11-15 15:46     ` Jesper Holmberg
  1 sibling, 0 replies; 8+ messages in thread
From: Peter Stephenson @ 2001-11-15 15:40 UTC (permalink / raw)
  To: Zsh users list

Mads Martin Joergensen wrote:
> * Peter Stephenson <pws@csr.com> [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@csr.com>                  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 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: backward kill
  2001-11-15 15:21 ` Peter Stephenson
@ 2001-11-15 15:34   ` Mads Martin Joergensen
  2001-11-15 15:40     ` Peter Stephenson
  2001-11-15 15:46     ` Jesper Holmberg
  0 siblings, 2 replies; 8+ messages in thread
From: Mads Martin Joergensen @ 2001-11-15 15:34 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh users list

* Peter Stephenson <pws@csr.com> [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?

(mmj@staudinger) ~> echo $ZSH_VERSION
4.0.4

(mmj@staudinger) ~> echo $ZSHEDIT
emacs

(mmj@staudinger) ~> cat .zshrc | grep bash
bindkey "^[^[[D" bash-backward-kill-word

And when I hit ESC left-arrow:
No such widget `bash-backward-kill-word'

-- 
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogic, with just a little bit more effort."
                                -- A. P. J.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: backward kill
  2001-11-15 15:05 Jesper Holmberg
@ 2001-11-15 15:21 ` Peter Stephenson
  2001-11-15 15:34   ` Mads Martin Joergensen
  2001-11-15 17:01 ` Will Yardley
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Stephenson @ 2001-11-15 15:21 UTC (permalink / raw)
  To: Zsh users list

Jesper Holmberg wrote:
> Hi all,
> 
> I am using the emacs key bindings. If I've written the following:
> 
> /path/to/some/file
> 
> 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).

-- 
Peter Stephenson <pws@csr.com>                  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 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


^ permalink raw reply	[flat|nested] 8+ messages in thread

* backward kill
@ 2001-11-15 15:05 Jesper Holmberg
  2001-11-15 15:21 ` Peter Stephenson
  2001-11-15 17:01 ` Will Yardley
  0 siblings, 2 replies; 8+ messages in thread
From: Jesper Holmberg @ 2001-11-15 15:05 UTC (permalink / raw)
  To: Zsh-users List

Hi all,

I am using the emacs key bindings. If I've written the following:

/path/to/some/file

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?

TIA

Jesper

-- 
          Jesper Holmberg            |"But how can |
  jesper.holmberg@enst-bretagne.fr   | one be warm |
ENST Br, BP 832, 29285 Brest, FRANCE | alone?"     |


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-11-15 18:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-15 15:02 backward kill Jesper Holmberg
2001-11-15 15:05 Jesper Holmberg
2001-11-15 15:21 ` Peter Stephenson
2001-11-15 15:34   ` Mads Martin Joergensen
2001-11-15 15:40     ` Peter Stephenson
2001-11-15 15:46     ` Jesper Holmberg
2001-11-15 17:01 ` Will Yardley
2001-11-15 18:43   ` Jesper Holmberg

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).