zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-users@zsh.org
Subject: Re: completing and hiding some prefixes
Date: Thu, 8 Aug 2013 20:16:09 +0100	[thread overview]
Message-ID: <20130808201609.17c923d6@pws-pc.ntlworld.com> (raw)
In-Reply-To: <ktu9r0$q7l$1@ger.gmane.org>

On Wed, 7 Aug 2013 20:14:25 +0000 (UTC)
Daniel <quite@hack.org> 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


      reply	other threads:[~2013-08-08 19:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07 20:14 Daniel
2013-08-08 19:16 ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130808201609.17c923d6@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).