Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPStorm Live templates not expanding

Tags:

ide

phpstorm

I've just started to play araound with PHPStorm and I can't get the live templates to work. For example there's one for a public function..'pubf' then tab to expand however when I tab mine out it looks like this...

<pubf></pubf>

What's going on? Is there a setting I need to enable to get it to work?

Thanks

like image 357
bencarter78 Avatar asked May 17 '14 07:05

bencarter78


People also ask

How do I use live templates?

To create a Live Template, in Android Studio or IntelliJ open Preferences ‣ Editor ‣ Live Templates. In this window, you can explore some of the existing templates you can use, what their shortcuts are, and edit the shortcuts and generated code. This is also where you can create a new template.

How do I use live Webstorm templates?

To configure live templates, open the Editor | Live Templates page of the IDE settings Ctrl+Alt+S . On the Live Templates page, you can see all the available live templates, edit them and create new templates. To make finding and editing templates easier, they are split into groups.

How do I use IntelliJ templates?

Press Ctrl+Alt+S to open the IDE settings and select Editor | File and Code Templates. and specify the template name, file extension, name of the resulting file, and body of the template. Apply the changes and close the dialog.

How do I add custom code to completion in IntelliJ?

Invoke type-matching completion By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Shift+Space or choose Code | Code Completion | Type-Matching from the main menu. If necessary, press Ctrl+Shift+Space once again.


2 Answers

Just for a little more clarity:

Even though you're under the PHP branch, you still need to apply the abbreviation to an application. Click the "Define" link and check the PHP box.

Define

like image 73
Ron Rebennack Avatar answered Sep 20 '22 11:09

Ron Rebennack


It was a question of scope for the template, just needed to select the appropriate file types.

like image 34
bencarter78 Avatar answered Sep 23 '22 11:09

bencarter78