Custom Grammer / CSS based on keyword


#1

What I am looking for is a package that will allow me to format based on a keyword. What I am hoping to do is to highlight a word or a line that contains a word or matches a regex expression.

My end goal is to fade out any line that contains a particular function, in this case it would be any line that contains my debugging function.

Example:
if (something===true) {
DEBUG.Log(‘Customer does want email sent’);
SendEmail(‘some@one.com’,‘subject’);
}

In the above it would be nice to be able to apply a custom css class to the line that contains DEBUG.Log so i can have the opacity be 0.5. I am using custom folds right now but it seems to make the code kinda bulky for this use case.

Maybe onSave/Load search document line by line and apply class if line contains… I dunno

Does a package like this exist?