I wanted to quickly share a solution to better AHK syntax highlighting in Notepad++. While I do not wish to disparage other editors, I haven't been able to find anything that I like as much as Notepad++ (or NPP for short). (I do not like SciTE4AutoHotkey for example.)
The problem is that NPP, with the current language files, has never done a good job with syntax highlighting. Consider the following as one example,
Send, % RemoveTrailingZeros(Round(Eval(math),DecimalPlaces))
The single % causes everything that comes after to highlighted as a variable. Ugly solutions are to add ;% (a comment with a percent sign). This makes NPP stop highlighting, but is annoying.
At any rate, I wanted to mention that I've achieved some success by looking at how to make a user defined language.
I'm making my userDefineLang.xml available as a download. This contains the userDefineLang.xml file and the AHK Autohotkey.xml file for auto completion. I got this latter file from somewhere on these forums but don't remember where now! (Readme.txt files in the zip explain where to put everything.)
Basically, my breakthrough was to remove the delimiters (% and %) and then use a keyword list in prefix mode with the % character. This causes a single % to turn on syntax highlighting, and as soon as it sees a white space character or an operator character, it turns off the highlighting.
I also add a number of new characters to the operator including a comma, so that things like Send, get highlighted properly. (Previously, keyword would only get highlighted if they were follow by a space.)
I also gave built in AHK variables a different colors that my own variables.
This solution is by no means perfect (you can find cases where things don't quite get properly highlighted), but in my testing, it's a big improvement on what I had before.
A real solution is getting an AHK lexer built into NPP. There seems to be a lot of potential for this but it hasn't happen yet.
I strongly feel that NPP is way ahead of the other editors in its capabilities. I'd like to see a real solution for AHK syntax but right now it's beyond my abilities.