Skip to content

Instantly share code, notes, and snippets.

@bgarrant
Last active November 21, 2022 17:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bgarrant/d5f15dd527f1da002579d8d60b53202d to your computer and use it in GitHub Desktop.
Save bgarrant/d5f15dd527f1da002579d8d60b53202d to your computer and use it in GitHub Desktop.
How to setup PHPStorm for Statamic Antlers

How to setup PHPStorm for Statamic Antlers

If any PHPStorm users want better syntax coloring for Antlers I figured out a better way.

  1. Install Handlebars/Mustache plugin and enable the checkbox for “Open HTML files as Handlebars/Mustache” under Languages & Frameworks > JavaScript > Templates. Not perfect but much, much better!

  2. This makes it even better. Disable Inspection and Syntax for Handlebars by click on Hector icon and changing the Highlighting Level for Handlebars to "None". Now no inspection errors!

  3. Enjoy Statamic Antlers inside .html files in PHPStorm.

@marcorieser
Copy link

Unfortunately, your solution caused problems with automatic formatting for me. So I have found a slightly different solution.
In the settings under Editor > File Types I added the pattern *.antlers.html to Twig and adjusted the syntax under PHP > Twig.

Bildschirmfoto 2021-05-07 um 01 52 58
Bildschirmfoto 2021-05-07 um 01 54 12
Bildschirmfoto 2021-05-07 um 01 57 31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment