opencode icon indicating copy to clipboard operation
opencode copied to clipboard

request: syntax highlighting for .txt files

Open OpeOginni opened this issue 2 months ago • 6 comments

Question

I just wanted to ask if changes for .txt files should look like this?

Image

OpeOginni avatar Nov 05 '25 16:11 OpeOginni

Is the issue those "No newline at end of file" comments? Just clarifying since idk the original state of ur text file

rekram1-node avatar Nov 05 '25 16:11 rekram1-node

No not really, just the fact it has no colors or nothing, just black and white makes it hard to read

OpeOginni avatar Nov 05 '25 16:11 OpeOginni

oh so u want text highlighting for .txt edits then?

rekram1-node avatar Nov 05 '25 16:11 rekram1-node

Yes sir, thats sort of what I am going with, if there is a need

OpeOginni avatar Nov 05 '25 17:11 OpeOginni

im gonna reword the issue to make it more clear, tbh im not sure what makes sense for a text file, i feel like most editors keep it 1 color.

Here is the file that'd need an edit tho i think: https://github.com/sst/opencode/blob/dev/packages/opencode/parsers-config.ts

rekram1-node avatar Nov 05 '25 17:11 rekram1-node

@rekram1-node I'm experiencing the same issue with .less and .vim files. When editing these file types, the diff view syntax highlighting does not work.

Screenshot attached showing the issue with a .vim file:

Image

This seems to be a general issue with file types that don't have built-in syntax highlighting support.

I can repro this also with the ghosty terminal. Thanks for the support.

Image

fabOnReact avatar Dec 05 '25 09:12 fabOnReact