@PeterJones said in How to add keywords for the HTML syntax highlighter?:
The Lexilla lexer for HTML does not have a provision for user keywords.
This was wrong, assuming “add keywords” meant adding new tags. You could obviously add new tags using the Style Configurator’s HTML > Tag > user-defined keywords. I think a year ago I was under the misunderstanding that you couldn’t add your own tags, because every time I had tried, I had done a mixedCase tag so I could easily identify it; I later learned that the lexer requires the keyword list to be all lowercase (which I thought was an odd limitation, because HTML itself is case-insensitive for tag names – but it has to do with the way that the lexer lowercases the tag text before comparing it to the list). So sorry for the misinformation last year.
Further, as I recently learned, the HTML lexer has the ability to enable “substyles” for the HTML TAG style, which you can assign your own color and your own list of keywords – so you could style your custom tags differently than the builtin tags if you want. Unfortunately, Notepad++ doesn’t (yet) enable those substyles, so you cannot do it natively in Notepad++. In this post, I share a script for the PythonScript which enables substyles – that specific post gives the example for PHP, but if you want to do the same for HTML, you would follow the same instruction, except edit the lists in class HTML_SubstyleLexer and append your colors/list definitions to the SCE_H_TAG in that class’s colorize.