Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by

These are the only fileviewer definitions inside my vifmrc
fileviewer *.* highlight -O xterm256 --validate-input -s freya
fileviewer Makefile highlight -O xterm256 --syntax Make -s freya

but Vifm keeps displaying its internal tree preview for directories and garbage for binary files that clearly doesn't match my rules since they doesn't contain dot in their names.

Is there a way do disable these default preview rules?

1 Answer

0 votes
Best answer

You can't disable them as they are used when nothing else matches, but you can overwrite them by adding one more :fileviewer command at the bottom:

fileviewer * echo NO PREVIEW AVAILABLE %i

It will handle everything that wasn't handled by previous rules. %i is there because %c is implicitly appended if no macro is used (and in this context %i is ignored).


Thanks for fast replay. One more question though: is it possible to use globs inside mime type patterns like that?

fileviewer <text/*> highlight...

EDIT: seems to work but not sure if its just a coincidence


It's not a coincidence, it's how it works. From documentation:

Mime type matching is essentially globs matching applied to mime type of a file instead of its name/path.