Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text/plain files not using bat #97

Open
tarikkirgin opened this issue Apr 5, 2024 · 2 comments
Open

text/plain files not using bat #97

tarikkirgin opened this issue Apr 5, 2024 · 2 comments

Comments

@tarikkirgin
Copy link

I have bat installed which works for viewing files such as .js or .ts with syntax highlighting in the terminal. However when using lf with ctpv the preview of these files are not coloured as shown below. I suppose for some reason it is falling back to cat despite the file having the MIME type text/plain.

image
@ipstone
Copy link

ipstone commented Jun 4, 2024

I have some similar issue when viewing file types such as *.R - text file but not showing preview. Are there options to customize the specific viewer to use, and default back to 'lf' default behavior? thanks

@Cliffback
Copy link

Same problem here. .ts files have application/javascript type for me, and don't natively appear with ctpv with bat but if I add the following the ctpv config file, it works when using ctpv in the terminal, but it seems custom configs like this breaks ctpv for lf, as I then loose even html highlighting through lf.

preview code application/javascript text/plain text/html {{
	bat --paging=never --style=plain --terminal-width="${w}" --wrap=character "${f}"
}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants