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

Context-aware file name completion with preferences



Hello dear zsh'ers

I switched from bash a ~month ago, and I've liked about everything zsh
has to offer. Relaxed flexibility, slick form and fast, what the heck.

There's only one greater issue that I haven't resolved yet. It's not a
harmful problem but I'd prefer to get it right for the sake of
usability.

I mean context aware file name completioning with set preferences:
which files are preferred in completion list, which aren't. I don't
want to exclude anything out; that would be too easy and somewhat
intolerant for naming mistakes. A few examples: consider a directory
with typical LaTeX document:

Doc1.tex
Doc1.aux
Doc1.dvi
Doc1.log
...

Of these files, I'd edit the .tex file most often: I would like zsh to
prefer .tex files to anything else from these files. They still should
appear in the completion cycle, but not first. In a similar manner I
would set file type preferences for "c", "cpp", "java" (speaking of
the devil, I hate the way bash always completes foo.class before
foo.java).

Is this doable? How about an opposite? There would be many files
readable by the editor, but I don't want to edit, say aux files very
often, if ever.

How to deal with this kind of demand? I hope zsh is up to the task :)

--Mikael



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