How to use Snippets in Aptana for Eclipse

UPDATE: the advice below is nolonger correct please see http://docs.aptana.com/docs/index.php/Adding_a_new_Snippet for explanation of snippets in Aptana for eclipse.

 

 

 

I use snippets extensively for things like custom function calls and other repetative tasks. CFeclipse loads the snippets view as part of it’s perspective, but when programming PHP Aptana does not by default. 

It’s taken me a while but I finally bothered to look for the snippets view in Aptana so they would be available when programming PHP.

To load snippets to your perspective go to:

“Window -> Show View -> Aptana standard views”.

Select “Snippets” and click OK.

Drag the view to where you want it in the perspective (I keep it next to my “Navigator” view)

Add a snippet by pressing control while clicking a section of text and selecting “Add to Snippets” you will be given the oportunity to edit the snippet, add it to a group, and specify replacement variables.

From there you can drag and drop snippets in Aptana to your hearts content!

Bookmark and Share

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments

This is not working for me… I press control while clicking a section of text, but I don’t see the “Add to Snippets” you are talking about….

I have a fresh Aptana install. Am I missing something?

Thanks!
- Pablo

You know I think I must have been drunk when I wrote this! My apologies I will update it when I have a moment, but I can no longer get this to work either (but have updated eclipse and aptana since that post so can’t be sure what’s happened).

Sorry to redirect you but check out http://docs.aptana.com/docs/index.php/Adding_a_new_Snippet for better advice! Thanks for your query.

Leave a comment

(required)

(required)