I needed to start working with Twig recently so I had to add syntax highlighting to Sublime for it. Pretty easy and the best tutorial I found was here:
The files can be downloaded from
or you can also clone them with:
git clone https://github.com/Anomareh/PHP-Twig.tmbundle.git
To install this bundle in Sublime Text, a few extra steps are required.
a) Open Sublime Text and in the Preferences menu click Browse Packages.
b) In the directory that was just opened, create a new directory PHP-Twig/.
c) Copy the content of the repo you downloaded into the directory you just created.
d) Move the contents of the PHP-Twig/Syntaxes/ directory to PHP-Twig/ (one directory up).
e) Restart Sublime Text.
To apply syntax highlighting on your Twig HTML files : Open a .html.twig file Go to View menu → Syntax → Open all with current extension as → HTML (Twig).