Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
complete based on contents of another folder or folders?
- X-seq: zsh-users 16195
- From: TJ Luoma <luomat@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: complete based on contents of another folder or folders?
- Date: Sun, 7 Aug 2011 06:21:49 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=N9WJKdunNREvWPghqytMTJkcf5JxGk20JP9BQ9IVphE=; b=c/Tw7Nqyk9GmZvr8ex3ipI1eMshWgKkb/mQWaP7ASRivUFYN0CWOZ0nrJGbjTvtGgH xJAzgnk2c0VDoJti3Mkq2f/oD3B69xDCbLT0e+kRu00PyvPq8QAel18ik+Cs5sBhFkbY Za4hZVHLqvX+/7nJeFr7NJgPtVY2JFDIZ11MA=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
I know almost nothing about Zsh's completion feature, other than it's
cool and I wish I took better advantage of it.
Here's are some of first things I'd like to do. I'm hoping that
someone might be able to explain this in a way that will allow me to
replicate this in other scenarios.
1)
"open -a [tab]" should offer "any file found in
/Applications/
/Applications/Microsoft Office 2011/
/Applications/Utilities/
/Applications/iWork '09/
which ends with '.app' and should not show the dirname (and doesn't
need to show the '.app' suffix, but that's not crucial).
(I assume that once completion is setup, 'open -a B[tab]' will only
offer apps which start with the letter "B")
I have to assume that someone has already invented this particular
'wheel' already.
2) Similarly
get_app [tab]
should offer completions based on files found in
~/Dropbox/get_app/rcs/ with the following stipulations:
- I only want the part of the filename up until the first literal "."
(and each file has at least one ".")
- no filenames do NOT have spaces in them
- subfolders may exist, but should be ignored (same is true for files
which begin with '.')
Thanks!
TjL
ps - Is there an "intro-to-zsh-completion" (aka "completion for
dummies" ;-) somewhere?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author