From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6663 invoked from network); 3 Jul 2003 14:40:24 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Jul 2003 14:40:24 -0000 Received: (qmail 17642 invoked by alias); 3 Jul 2003 14:40:10 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6368 Received: (qmail 17627 invoked from network); 3 Jul 2003 14:40:10 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 3 Jul 2003 14:40:10 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [213.46.243.24] by sunsite.dk (MessageWall 1.0.8) with SMTP; 3 Jul 2003 14:40:9 -0000 Received: from s.hn.org ([80.111.3.215]) by amsfep13-int.chello.nl (InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with SMTP id <20030703144009.IGWM16676.amsfep13-int.chello.nl@s.hn.org> for ; Thu, 3 Jul 2003 16:40:09 +0200 Received: (qmail 3965 invoked by uid 1000); 3 Jul 2003 14:40:03 -0000 Date: Thu, 3 Jul 2003 16:40:03 +0200 From: Haakon Riiser To: zsh-users@sunsite.dk Subject: Re: Readline-like ^W behavior Message-ID: <20030703144003.GA3562@s.chello.no> Mail-Followup-To: zsh-users@sunsite.dk References: <20030703125004.GA1792@s.chello.no> <2170.1057238488@csr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2170.1057238488@csr.com> User-Agent: Mutt/1.4.1i [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