How to turn off ALL syntax highlighting for a single file?
Whenever I make a file called notes.txt the highlighting is super annoying and not correct.
How do I turn off *all* syntax highlighting for one specific file?
Note, the text should look light gray and show *NO* highlighting?
I think this should be as easy as right-clicking on the file and selecting "Turn off syntax highlighting"
Is there a method for this?
Please sign in to leave a comment.
What file type is recognized for notes.txt? You can check it by the file icon.
Check your file type settings and make sure *.txt pattern is set for Text file type. This can be changed without your notice by custom plugins, e.g. the Requirements plugin did this to me once.
Maybe you can make sense of this...
I think this picture shows you all you need to know.
Andy i am not sure why there is *any* syntax highlighting on *any* .txt files
How do I turn it off?
Also,
Assuming I had one .py file that I *DID not want* syntax highlighting on for some reason, how would I turn it off for just that file?
Well, as your screenshot shows, *.txt falls under requirements.txt pattern.
You can disable requirements plugin if you don't need it
OR
Change file type settings according to my screenshots.
>Assuming I had one .py file that I *DID not want* syntax highlighting on for some reason, how would I turn it off for just that file?
Sorry, I haven't found a way to do that. You can setup your specific file, e.g. "foo.py" as text file type, while leaving the rest of *.py as python. But this still leaves some syntax highlighting. However I don't see why anyone would want that. You can just rename it to foo.py.txt
Thanks - fixing that wildcard for the plugin helped.
As for the syntax highlighting, there are several reason (sometimes it is just annoying).
Not being able to turn it off (it is a feature, right? not a requirement) without navigating through file types is kind of a limitation.
Thanks Andrey Resler your clue did the trick: the icon next to the file name matches the icon in Settings | Editor | File Types | Recognized File Types. That helped me find the overeager `*.txt` under the Requirements language | File name patterns and remove it.
My text files had suddenly turned orange after moving to a new computer.
UPDATE 2023 happened again, `*.txt` snuck back into Settings | Editor | File Types | Requirements language. Really coming to dread PyCharm updates.