Skip to content

Instantly share code, notes, and snippets.

@jurosh
Last active October 23, 2016 15:45
Show Gist options
  • Save jurosh/b4dc6098c5a3fea461c938dce6378a73 to your computer and use it in GitHub Desktop.
Save jurosh/b4dc6098c5a3fea461c938dce6378a73 to your computer and use it in GitHub Desktop.
PHP Storm JavaScript Live Templates (Macros/Shortcuts)

JavaScript live templates for PHP Storm

How to use live templates (macros)

https://www.jetbrains.com/help/phpstorm/2016.2/live-templates.html

Templates

Quick import like: import something from 'some/package';

ES6 Import

Abbr: i + TAB

import $END$ from '$LIB$';

Usage: type i and press TAB

Console.log

Abbr: cl + TAB

console.log($END$);

Usage: type cl and press TAB

Wrap with function

Abbr: w

$END$($SELECTION$)

Usage: select variable and press CTR + ALT + j to open menu (just to test) - TODO direct shortcut.

...

Tips

https://www.jetbrains.com/help/phpstorm/2016.2/surrounding-blocks-of-code-with-language-constructs.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment