From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14990 invoked from network); 1 May 2004 14:15:58 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by ns1.primenet.com.au with SMTP; 1 May 2004 14:15:58 -0000 Received: (qmail 11899 invoked from network); 1 May 2004 14:15:19 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 May 2004 14:15:19 -0000 Received: (qmail 13607 invoked by alias); 1 May 2004 14:15:11 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7422 Received: (qmail 13595 invoked from network); 1 May 2004 14:15:10 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 1 May 2004 14:15:07 -0000 Received: (qmail 11108 invoked from network); 1 May 2004 14:15:07 -0000 Received: from main.gmane.org (80.91.224.249) by a.mx.sunsite.dk with SMTP; 1 May 2004 14:15:04 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BJvGh-0007kb-00 for ; Sat, 01 May 2004 16:15:03 +0200 Received: from cpc3-oxfd4-4-0-cust194.oxfd.cable.ntl.com ([80.3.247.194]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 May 2004 16:15:03 +0200 Received: from david by cpc3-oxfd4-4-0-cust194.oxfd.cable.ntl.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 May 2004 16:15:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@sunsite.dk From: zzapper Subject: Re: Completion of CLI parameters Date: Sat, 01 May 2004 15:14:57 +0100 Message-ID: <65c790119uqg8063k7r9eoft9vp1n2vvd2@4ax.com> References: <15385.1083243379@csr.com> <1040429145959.ZM31110@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: cpc3-oxfd4-4-0-cust194.oxfd.cable.ntl.com X-Newsreader: Forte Free Agent 1.93/32.576 English (American) Sender: news 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=BAYES_01,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: -0.0 On Thu, 29 Apr 2004 14:59:58 +0000, wrote: >On Apr 29, 1:56pm, Peter Stephenson wrote: >} >} autoload -U insert-args-of >} zle -N insert-args-of >} bindkey '^x^a' insert-args-of > >Oliver would say this was crying out to be a _generic completer; here's >a trivial stab at one. However, the right thing would be for _expand to >recognize a zstyle -- perhaps named "expander" -- that would supply a >function to produce expansions, and to try calling that before falling >back on the usual shell expansions. That way we'd get the full power of >all the other styles recognized by _expand. > >The following suffers from the usual problems of menus that may contain >multi-line structures, I haven't done anything to address that. > >#autoload ># Name this file expand-args-of and place it in a $fpath directory, and ># then add these commands to .zshrc: ># zle -C expand-args-of complete-word _generic ># zstyle ':completion:expand-args-of::::' completer expand-args-of ># bindkey '^x^a' expand-args-of > >local pat=$words[CURRENT] >local -a exp > >if ((CURRENT > 1)) >then > # Remove the first * here to match on command name only > exp=( $history[(R)*${(q)pat}*] ) > exp=( ${exp#*[[:space:]]} ) >else > exp=( $history[(R)${(q)pat}*] ) >fi >compadd -UQ -a exp >compstate[insert]=menu > >#end of expand-args-of This one just beeps at me?!? zzapper (vim, cygwin, wiki & zsh) -- vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?" http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips