From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24957 invoked by alias); 8 Aug 2013 19:24:17 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17914 Received: (qmail 20437 invoked from network); 8 Aug 2013 19:24:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 209.85.215.171 is neither permitted nor denied by SPF record at ntlworld.com) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=wBb70DGfOhoodGonbK4prcK2RiZp0exbv3eD7ONr/U8=; b=mF9YCML4YqCmz97ixvq+vDAubdSbx79NvuladAbjb4c1h6b7KyLc6v8+6GjoUnj4pv JBFGRROQ3zTwhgZSa5ZU/hFx7qzY6gcuZp5dDmsCZOcX9GC+ECFzGRJmqcaQt9shRDPO wmH9B9A1ZqqJXLg2MFNw8I1FTllGi7HDT0gzCY50We1JG00UDZcS5wdxw9YYGXEpz//A 5aRcnQED8/mSqmCOijA7dKcMtb+fbr0zHoAqcxiuxyM88q9f0r3u840lpe/DPZl2IiKF +usGDw+3T/gLkNVBpSPBRMEQ9IdO9ttw7jMfXyBcCepfIkqzqbPVTsmXtMe2STTq+qrQ nBPw== X-Gm-Message-State: ALoCoQmVEJs+0kWdzug4kx6Ci3RhRDLBvTZOVQRFJWinrHkU7wPDTUZzbo9i+qDF+abXCGR0kRyK X-Received: by 10.14.251.137 with SMTP id b9mr9516634ees.150.1375989372167; Thu, 08 Aug 2013 12:16:12 -0700 (PDT) X-ProxyUser-IP: 86.6.30.159 Date: Thu, 8 Aug 2013 20:16:09 +0100 From: Peter Stephenson To: zsh-users@zsh.org Subject: Re: completing and hiding some prefixes Message-ID: <20130808201609.17c923d6@pws-pc.ntlworld.com> In-Reply-To: References: X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 7 Aug 2013 20:14:25 +0000 (UTC) Daniel wrote: > I have files in ~/foo/. Among them, some are named: fa_abc fa_frog > fa_gag. I want to write completion for a command "fofa", which completes > among these particular files, but omitting the "fa_" prefix. Thus: > > $ fofa [TAB] > $ fofa abc[TAB] > $ fofa frog You need something like this. pws #fofa local cachedir=~/foo expl local -a files files=($cachedir/fa_*(:t)) files=(${files##fa_}) _wanted foo-cache expl 'foo cache' compadd -a files