Search code examples
webstormjetbrains-idejetbrains-toolbox

Emmet not working in WebStorm in .php files


I just started using WebStorm. Emmet is working perfectly with .html files, but not with .php files. Any fix for that?

Problem: writing .container + clicking on Tab should give <div class="container"></div>, but it's not doing that in PHP files. In HTML files it's working perfectly.


Solution

  • In WebStorm, .php files are simple text files highlighted using textmate bundles; HTML language is not injected there, so advanced HTML features do not work.

    As a workaround, you can try modifying Zen HTML live templates context in Settings | Editor | Live Templates by appending Other to it, like:

    enter image description here

    but this has to be done for each template separately