Please consider editing your post and mark it as obsolete instead. Do you want to delete post?
Is a code snippet library coming soon?
Edgar Martinez
Created
Hi Just wondering if there is any new on including a code snippet library. I have a lot fo code snippets of my own I want to add but currently there is jno way fo doing this
I'd love to see a snippet capability too. I tried the eSnippet Pro plugin, but I want the ability to easily maintain my own "library" of snippets. This would be a great addition to PhpStorm.
Go to File -> Settings -> Live templates Click the + button to add one Make the abbreviation your short cut text. Paste your snippet in the textarea Pick the context (phpStorm EAP 3*) is the Define link on the bottom.
Apply
Now when coding under the context you picked you can type your abbreviation and hit tab or enter or what ever the expand selection you picked was. This will insert your snippet.
You can also have placeholder vars. They are defined like $var$ This creates a tab stop in your snippet..
No such plans.
I'd love to see a snippet capability too. I tried the eSnippet Pro plugin, but I want the ability to easily maintain my own "library" of snippets. This would be a great addition to PhpStorm.
Yeah I tried E-snippet 2 but it isnt working very well. or rather i have not gotten it to work
I think phpStorm has something better than a snippet library. (Live Templates)
Assign your snippet a tag and away you go, nice short cut and everything.
Its one of my favorite tools in phpStorm.
I Have no idea how to sue live templates or what they are for can you explaine a bit
Select and copy your code snippet.
Go to File -> Settings -> Live templates
Click the + button to add one
Make the abbreviation your short cut text.
Paste your snippet in the textarea
Pick the context (phpStorm EAP 3*) is the Define link on the bottom.
Apply
Now when coding under the context you picked you can type your abbreviation and hit tab or enter or what ever the expand selection you picked was.
This will insert your snippet.
You can also have placeholder vars.
They are defined like $var$
This creates a tab stop in your snippet..
I qq'ed about the lack of snippets in PHPStorm for months until I discovered Live Templates. Try it.
Jeff: Thanks! I've tried it and it looks great. It would be nice to have a Tool window to list them, but that is just to help my bad memory... ---Jim
Code|Insert Live template (Ctrl+J) will help you. Type to narrow abbreviation list down, look at descriptions!