8

I recently started a new project in PHPStorm, but noticed that none of my HTML elements are being auto closed like in my other projects.

If I type

<div>

the editor autoloads the

</div>

How do I turn this feature back on?

4 Answers 4

15

File > Settings > Editor > Emmet > HTML

Under Filters Enabled By Default tick Comment Tags.

You'll then find if you use Emmet's syntax, for example:

.test#test TAB

It'll output:

<div class="test" id="test"></div>
<!-- /#test.test -->
1
  • 1
    Thanks, this is very useful! Commented May 30, 2017 at 11:18
8

Yes you can do this by setting your PHPstorm

Go to PHP Storm -> File -> Setting -> Editor -> Smart Keys -> XML/HTML

Check all or what you want, then Press Ok.It is done.

Reference : http://www.jetbrains.com/phpstorm/webhelp/editor-smart-keys.html

1
  • 2
    Setting doesn't exist, URL is dead. Top Google result.
    – Dave Heq
    Commented Aug 3, 2016 at 20:55
8

If you type div and then press Tab, then it will auto-complete for you. PHPStorm has emmet built in in verisons 6 and 7 as far as I know.

1
  • This doesn't work either; tapping Tab just indents after the </
    – Dave Heq
    Commented Aug 3, 2016 at 20:55
0

In PHPStorm Version 2017.3 you can change this setting at:

File > Settings > Editor > General > Smart Keys > XML/HTML > Insert closing tag on tag completion

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.