Search code examples
htmlautocompletetagsphpstormsublimetext3

Selecting tags in PhpStorm. I want to open tag in PhpStorm, close it and put selector inbetween (like in Sublime)


I just started using PhpStorm and can't find way to set selecting tag while writing like in Sublime.

In ST if I start typing <di I get list of tags and probably the first one is <div> As I click enter, div is being selected: Sublime opens tag, closes it and puts my selector between starting and ending tag. Unfortunately PhpStorm doesn't do so. It shows me options and let to choose some but I still need to close starting tag, write what I want and write </ to close it. I like to have start and end tag given stright away so I later won't forget to close it or so...


Solution

  • Enter div and hit Tab => you will get <div></div> created, with caret placed after start tag. Or, type <di, choose div from completion, then type > - you will get the closing tag auto-added as well (if Insert closing tag on tag completion is enabled in Settings | Editor | General | Smart Keys, XML/HTML)