From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22882 invoked from network); 15 Mar 2002 08:55:56 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 15 Mar 2002 08:55:56 -0000 Received: (qmail 10224 invoked by alias); 15 Mar 2002 08:55:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16837 Received: (qmail 10211 invoked from network); 15 Mar 2002 08:55:49 -0000 From: Sven Wischnowsky MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15505.46831.979708.369781@wischnow.berkom.de> Date: Fri, 15 Mar 2002 09:55:11 +0100 To: zsh-workers@sunsite.dk Subject: Re: (backward-)kill-argument In-Reply-To: References: X-Mailer: VM 6.95 under 21.5 (patch 3) "asparagus" XEmacs Lucid Michal =?iso-8859-2?q?Maru=B9ka?= wrote: > i want to: > * kill filenames w/ spaces: e.g. this\ is\ file.txt Write yourself a little widget. As a starting point: zle -N kill-with-spaces kill-with-spaces() { local words words="${(z)BUFFER}" BUFFER="${BUFFER%${words[-1]}[ ]#}" } bindkey kill-with-spaces (There's a space and a TAB inside that [ ].) > * maybe even the bracketed part: > find { -name '*.h' } > > Is it possible in Zsh? Using the above you could check if $words[-1] is one of the closing braces and if it is, search back in the array for the matching opening brace. When found, you can delete the end of $BUFFER up to that matching brace by using a pattern of the form: ${words[-n]}[ ]##...[ ]##${words[-1]}[ ]# Bye Sven -- Sven Wischnowsky wischnow@berkom.de