Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by
edited by

as title, I'm trying to setup a fileviewer like this

fileviewer {*.*},<text> bat %c

for all readable files, but that is not working as intended:
- it set a view for folders with a period in the name
- it try to view every files, even if they are image, videos etc

thank you in advance

edit: I solved with this

fileviewer <text/plain> bat %c
by

You might try something like this:

fileviewer *[^/] env -uCOLORTERM file -bL --mime "%c" | grep -q '^text' && bat --color always --wrap never --pager never --style=plain,,changes %c || xxd -l1024 %c | cut -d" " -f11 | column

1 Answer

+1 vote
by

You might be looking for this instead:

fileviewer <text/*> bat %c

because there are non-plain text files (e.g., source code).

by

that's even better, thank you!

...