Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 423
Frederick M. Rogers Avatar asked May 21 '17 12:05

Frederick M. Rogers


People also ask

How do you add a boilerplate in HTML?

HTML5 Shortcut To try the shortcut, create a new HTML file in Visual Studio Code. Then, start typing html . From the intellisense dropdown, select html:5 and press Enter key. Visual Studio automatically brings the boilerplate HTML5 code to the file.

How to run HTML in PhpStorm?

From the main menu, select File | New, and then select HTML File from the list. PhpStorm creates a stub file based on the HTML file template and opens it in the editor.


1 Answers

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.

like image 61
LazyOne Avatar answered Sep 20 '22 15:09

LazyOne