This extension for Nova, a text editor from Panic, adds syntax highlighting for Twig, a popular templating language. It supports all relevant language features from Twig 3.0+ and even some custom tags/filters from Craft CMS 3.0+.
This extension also includes a huge list of completions for Twig and Craft CMS 3.0+, including Element Queries.
In Nova, go to “Extension > Extensions Library”, search for “Twig” and install the extension.
Manual way: Download this repository, extract the .zip file and open the folder with Nova.
If you use Twig inside Markdown files (e.g. Grav CMS): Map “.md” to “Twig-Markdown” in settings to activate syntax highlighting for Twig inside regular Markdown files.
Clone this repository and open the folder with Nova. In Nova, go to “Settings > General” and enable “Show extension development items in the Extension menu”. Then activate the extension via the “Extension” menu.
- Migrate all syntax definitions and completions to Tree-sitter (Nova 10+)
- Update completions for Craft 4+
- Add support for matching Twig brackets (not possible at the moment?)
If you have some tips or want to help with development, feel free to let me know!