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.

How to disable defalt filepreview for directories and binary files?

0 votes
asked Jul 14 in vifm by anonymous

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
answered Jul 14 by xaizek
 
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).

commented Jul 15 by anonymous

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

commented Jul 15 by xaizek

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.

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...