1

Just wondering how I could add operator highlighting in Sublime Text 2. None of the default themes highlight operators and the tmLanguage file for Monokai doesn't seem to have any option for operators either. Can anyone tell me how this can be done? Thanks.

Rokit
  • 977
  • 13
  • 23

1 Answers1

0

I don't think the highlighting can be done i general. However, this can be done for specific syntaxes by creating (or editing) .tmLanguage files (references can be found in this answer: https://stackoverflow.com/a/11288058/4207760).

For instance by adding =| to the (regex) match key in the standard C.tmLanguage file:

<key>match</key>
<string>\b(break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while)\b</string>

this becomes:

<key>match</key>
<string>\b(=|break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while)\b</string>

and all equality signs (=) are now highlighted pretty much like "if", "else", "for" etc.

Community
  • 1
  • 1
Solstad
  • 285
  • 1
  • 9