Search code examples
htmltemplatesphpstorm

PhpStorm - HTML 5 boilerplate code snippet


I am an avid user of Visual Studio Code and before that Sublime Text. I have recently started using PhpStorm for my Laravel projects and I am really missing the ability to instantly produce a simple HTML 5 boilerplate template by simply typing html + TAB.

Is there anything similar in PhpStorm?


Solution

  • Is there anything similar in PhpStorm?

    ! + Tab IIRC.

    In IDEA-based IDEs it's called Live Templates. IDE also supports Emmet.

    All Live Templates can be found at Settings/Preferences | Editor | Live Templates -- you can modify exiting or add your own (I suggest using own groups for own templates -- less possible hassle with updates and sharing).

    Snippets for HTML (plus standard Emmet abbreviations) are located under Zen HTML node.

    You can also customise the expand key:

    • by default it's offered among usual Tab, Space and Enter .. but you can also configure your own shortcut.
    • each Live Template can be set to use different expand key (among those mentioned above) .. although I do not really see any real benefit for this.

    You can also use File Templates ([ 1 ] and [ 2 ]) to make files with some predefined content/structure.