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

Re: open file with tex extension



> > Now, I look for a way to adjust the completion so that when
> > I type the name of the latex file zsh completes the
> > extension to '.tex' and does not give any other options
> > like:
> > [example]
> > Is that somehow possible?
>
> you can ignore certain patterns for completion:
>
> zstyle ':completion::*:(vi|vim):*' ignored-patterns \
>           '*?.(aux|dvi|log|idx|pdf|rel|out)'
> zstyle ':completion::*:(vi|vim):*' ignored-patterns '*~'

A possibly better solution would  be to complete on the tex file
first, but would still complete on the other files if there is no
other completion :
zstyle ':completion::*:(vi|vim):*' file-patterns '*.tex' '*'

...that way, if there is a tex file and you hit tab, zsh will complete
on the tex file even if there are other acceptable completions.


It's also possible, and probably even better, to complete first on
whatever is not one of the outputs of latex, while retaining the
completion on them failing that.
zstyle ':completion::*:(vi|vim):*' file-patterns
'*~*.(aux|dvi|log|idx|pdf|rel|out)' '*'

--
J
"Toi, je te trouve pas la même tête que sur la page précédente" -- Wakamiya


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