From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13357 invoked from network); 18 Jul 2004 02:33:21 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Jul 2004 02:33:21 -0000 Received: (qmail 30352 invoked from network); 18 Jul 2004 02:32:59 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Jul 2004 02:32:59 -0000 Received: (qmail 24182 invoked by alias); 18 Jul 2004 02:32:14 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7711 Received: (qmail 24172 invoked from network); 18 Jul 2004 02:32:13 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 18 Jul 2004 02:32:13 -0000 Received: (qmail 29221 invoked from network); 18 Jul 2004 02:31:09 -0000 Received: from unknown (HELO moonbase.zanshin.com) (167.160.213.139) by a.mx.sunsite.dk with SMTP; 18 Jul 2004 02:31:06 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i6I2V5VW025022 for ; Sat, 17 Jul 2004 19:31:05 -0700 Date: Sat, 17 Jul 2004 19:31:05 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-users@sunsite.dk To: zsh-users@sunsite.dk Subject: Re: zshzle: aborting history search In-Reply-To: Message-ID: References: <7b9.40f9587d.a8ae6@georgn.fqdn.th-h.de> <20040717184743.GA9358@blorf.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Sat, 17 Jul 2004, Georg Neis wrote: > "bck-i-search: cat /fo" turns into "failing bck-i-search: cat /fo" > because the command is (for whatever reasons) not in my history file. > Now I want to [move] "cat /fo" from the search prompt to the normal > command prompt copy-search-as-buffer() { zle end-of-history; BUFFER="$LASTSEARCH" } zle -N copy-search-as-buffer bindkey '\ee' copy-search-as-buffer Choose your own binding in place of escape-e, I just picked something that isn't bound by default. The "end-of-history" isn't strictly necessary, but it means you aren't left with a modified buffer in the middle of the history after the first part of the incremental scan.