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

Completions from file with zcompsys



Back in the time of compctl there were a lot of hand written
completions in my config, but compsys this has all gone away for
the default completions on the system.  Now I need something
special for a hand written command, and the amount of
documentation in the zshcompsys and zshcompwid manpages is
overwhelming.  Are there some quick instructions instructions or a
cheat sheet on the new completion system somewhere?

The task at hand is:  Some command, say "foo", takes lines from a
certain, pre-written, sorted file as possible completions.  (The
lines are actually latin plant names which should not matter.),
e.g.:

-- snip --
...
Chenopodium acuminatum
Chenopodium album
Daucus carota
...
-- snip --

And I want to type things like

  $ foo Cheno<TAB>alb<TAB>   # -> Chenopodium album
  $ foo Che*a<TAB>           # -> Chenopodium a

(using menu completion, not expanding the * to all matching
completions).  This is probably only one or two lines in the
config.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt



Messages sorted by: Reverse Date, Date, Thread, Author