Custom Syntax Highlighting


If I wanted to make a theme that did custom syntax highlighting in the “Plain Text” mode, how would I go about customizing which words get highlighted which color?


The whole point of the “plain text” mode is that it is plain text, there aren’t any constructs that will get highlighted. If you want to take a look at something that places very minimal rules on top of plain text … but is a separate mode from plain text, you can look at my language-generic-config package.


I would consider making a new grammar that does what you want and then switch those files to that grammar when loaded.


How exactly would I do that?


Does your language-generic-config package only work for comments though?


I assume you are asking about switching files to a grammar. Just click on the little word on the right side if the status bar and you’ll get a box that lets you select a grammar.


Yes, my package is only for files that contain comments and non-comments. I was suggesting you could look at it as an example of how you could do something similar that covers what you want.