From: Haakon Riiser <haakon.riiser@fys.uio.no>
To: zsh-users@sunsite.dk
Subject: Re: Readline-like ^W behavior
Date: Thu, 3 Jul 2003 16:40:03 +0200 [thread overview]
Message-ID: <20030703144003.GA3562@s.chello.no> (raw)
In-Reply-To: <2170.1057238488@csr.com>
[Peter Stephenson]
>> Is it possible to make ^W delete the word to the left of the
>> cursor with the same word-boundary rules as in readline/bash?
>> Here's what I'm looking for:
>> [...]
>
> So you're assuming unix-word-rubout in bash? (The usual
> bash/readline rules for words are to use alphanumerics only,
> but the default ^w binding does what you show.)
I'm a little confused here now: bash(1) and readline(3) state
that ^W is by default bound to unix-word-rubout, which uses
whitespace for word boundaries:
unix-word-rubout (C-w)
Kill the word behind point, using white space as a
word boundary. The killed text is saved on the
kill-ring.
I tried making it explicity by putting
"C-w": unix-word-rubout
in ~/.inputrc and (as expected) it made no difference.
> As you're using zsh 4.1.1, you have an easy solution: redefine
> backward-kill-word to the Swiss-army-knife function variant
> with `-match' appended, and set the style to use whitespace
> word boundaries:
>
> bindkey '^w' backward-kill-word # as before
> autoload -U backward-kill-word-match
> zle -N backward-kill-word backward-kill-word-match
> zstyle ':zle:backward-kill-word' word-style whitespace
Thanks -- that's exactly what I was looking for! :-)
--
Haakon
next prev parent reply other threads:[~2003-07-03 14:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-03 12:50 Haakon Riiser
2003-07-03 13:21 ` Peter Stephenson
2003-07-03 14:40 ` Haakon Riiser [this message]
2003-07-03 14:48 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030703144003.GA3562@s.chello.no \
--to=haakon.riiser@fys.uio.no \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).