Well, I went ahead and made a new syntax file for my templates. It took a long time to get right, but it's the way I want it now. I used the html syntax file and just edited it around so it highlights things in braces differently. I didn't really need it in red, I just chose that color because it isn't a very common color in highlighted html files. Actually, I fixed it so that the template variables have a different background color. I can't really show it on here, but these are the lines I added:
Code:
syn region tplVariable start=+{+ end=+[}\n]+ contains=tplVariablePart,tplVariableError
syn match tplVariableError contained +[^}^{\W]+
syn match tplVariablePart contained +\w+
hi tplVariable guifg=White ctermfg=White gui=Inverse cterm=Inverse
hi tplVariablePart guifg=White ctermfg=White gui=Inverse cterm=Inverse
hi tplVariableError guifg=DarkRed ctermfg=DarkRed gui=Inverse cterm=Inverse
The first line sets the region (beginning and end) for the variable and tells it to interpret tplVariablePart and tplVariableError differently. Otherwise anything from { to } is just a regular tplVariable. The second line sets all non-words (excluding braces) as an error inside the tplVariable. That's a personal decision because I think the variables can be composed of almost anything. The third line sets all alphanumeric characters (including underscores) to be the body of the tplVariable. The last three lines just set up the colors for the first three lines. So any errors come up as black on dark red, and a correctly formated variable is black on white. In order to get this working properly I think you'd also have to add tplVariable to the "contains" field of other syntax regions (like strings).
I've pretty much gotten the hang of this syntax thing so let me know if I need to elaborate on any of this.