atom / language-todo

TODO highlighting package for Atom
Other
80 stars 66 forks source link

Different Colors/Patterns [Question] #19

Closed Zilarrezko closed 9 years ago

Zilarrezko commented 9 years ago

Is it possible to specify different colors for specific keywords? I know how to change the keywords, though I am unsure where it's grabbing the colors from and how I would give certain ones certain colors.

I do have my own syntax theme, and already have colors set up for them, if that helps point me in the right direction.

Thanks in advance.

lee-dohm commented 9 years ago

The scope for the keyword itself is storage.type.class.keyword where keyword is the lowercased version of the keyword, i.e. TODO, HACK, FIXME, etc. Most syntax themes will color this differently than comments, but if you want to give each keyword a different color ... then all you have to do is add a style for each keyword in your syntax theme:

.storage.type.class.todo {
  color: green;
}

.storage.type.class.fixme {
  color: yellow;
}

.storage.type.class.hack {
  color: red;
}
Zilarrezko commented 9 years ago

hmm... I see the name matches what you're saying in the todo.json. Although, It doesn't seem to work?

butididit

Zilarrezko commented 9 years ago

Ah, scratch that. A separate complicated problem, but it works now, thanks.

Zilarrezko commented 9 years ago

Actually, is there a way I can specify outside of the todo.json the pattern of words to highlight?

kevinsawicki commented 9 years ago

Actually, is there a way I can specify outside of the todo.json the pattern of words to highlight?

Nope, you could fork this package and tweak the grammar to highlight the values you want though.