You can see here, I have added the PHP conditional keywords definition after the C/C++ compile switches under the setting entitled brackets.
// C/C++ compile switches
{
"name": "c_compile_switch",
"open": "(\\#(?:if|ifdef|ifndef))\\b",
"close": "(\\#endif)\\b",
"style": "default",
"scope_exclude": ["string", "comment"],
"language_filter": "whitelist",
"language_list": ["C++", "C"],
"enabled": true
},
// PHP conditional keywords
{
"name": "php_keywords",
"open": "^\\s*\\b(if|foreach|for|while|switch)\\b(?=.*:$)",
"close": "^\\s*\\b(endif|endfor|endforeach|endwhile|endswitch)\\b(?=;$)",
"style": "default",
"language_filter": "whitelist",
"scope_exclude": ["string", "comment"],
"plugin_library": "User.phpkeywords",
"language_list": ["HTML", "HTML 5", "XML", "PHP", "HTML+CFML", "ColdFusion", "ColdFusionCFC"],
"enabled": true
}
],
Lastly, you create a file called phpkeywords.py in your ST2 User folder with this code:
def compare(name, first, second, bfr):
return "end" + bfr[first.begin:first.end].lower() == bfr[second.begin:second.end].lower()
If I remember, I will add this by default into BracketHighlighter tonight.