Custom Syntax Highlighting


#1

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?


#2

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.


#3

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


#4

How exactly would I do that?


#5

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


#6

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.


#7

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.