Changing the color of specific words


I’m completely new to atom, and I’m trying to figure out a way to make specific words different colors. I’m really only using this for a few of the files that I use in for Civil3D.

I’d like anything after an * to be recolored up until the first , and there would be different colors for different key words.
For example:

*FIRE,Fire ---- F ---- F ---- F ----


" *FIRE, " just the word FIRE would be colored RED or something.

*STORM_DRAIN,Storm Drain ---- D ---- D ---- D ----

" *STORM_DRAIN," just the words STORM_DRAIN would be colored green.

I just wanted to know if doing this is possible, and if so what steps would I need to take to accomplish this?


It is technically possible to use markers and decorations to do this.

Alternatively, you can write a grammar that injects itself into whatever grammars you want that behaviour in. I don’t know what Civil3D is, but if there is an existing grammar for it (likely called language-civil3d or something), then I can help with that.

Once you have a grammar, you can target the scopes with your stylesheet.