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

Re: zsh completion of just latex files



On Wed, 23 Jun 2004, Pierre HABOUZIT wrote:

> [I, that is Bart, wrote:]
> > zstyle ':completion:*:*:vtex:*' file-patterns \
> > 	'*.tex:tex-files' '*.toc:toc-files *.dvi:dvi-files' '%p:all-files'
> 
> I would like to do something like that but that creates a new group
> name.

That's essentially what the above example does, except that it doesn't
supply descriptions for the groups.

In the doc for the file-patterns style, you'll find:

     The TAGs of all strings in the value will be offered by _files and
     used when looking up other styles.  Any TAGs in the same word will
     be offered at the same time and before later words.  If no `:TAG'
     is given the `files' tag will be used.

     The TAG may also be followed by an optional second colon and a
     description, which will be used for the `%d' in the value of the
     format style (if that is set) instead of the default description
     supplied by the completion function.  If the description given
     here contains itself a `%d', that is replaced with the description
     supplied by the completion function.

So something like:

 zstyle ':completion:*:*:kghostview:*' file-patterns \
     '*.(ps|pdf):pspdf-files:PostScript\ or\ PDF\ files' \
     '%p:all-files:all\ other\ files'



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