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

Re: zsh completion of just latex files



On Tue, 22 Jun 2004, zzapper wrote:

> In a directory full of latex files *.tex and all the *.toc *.dvi etc I
> want a widget to only complete *.tex  file eg
> 
> vtex some_tex_file.tex
> 
> How should I do this?

Assuming (a) that you're using compsys rather than compctl and (b) that 
there isn't already a specialized completer for "vtex", the way to do this
is with the zstyle mechanism, specifically the file-patterns style.  The
example in the manual is very similar to this:

zstyle ':completion:*:*:vtex:*' file-patterns \
	'*.tex:tex-files' '*.toc:toc-files *.dvi:dvi-files' '%p:all-files'

This means to first try to complete tex files, then (simultaneously, note
that the next two specs are both in the same string) toc or dvi files if
there are no tex, and finally all files.



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