Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

complete based on contents of another folder or folders?



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