views:

352

answers:

1

hi,

i'm currently evaluating eclipse after using textmate for all my development for many years. what i miss in eclipse and what i can't find any solution for are some kind of generic templates:

i'm using PDT for my javascript and php development, and it supports code-templates. however , in my projects i'm writing large amounts of shell-scripts, yml-configuration-files, xml-files, gnu make scripts, etc., too. i'm writing source-documentation for all these scripts using a generic syntax (similar to robodoc) and you can save much time, when you can insert the doc-blocks using templates. however, besides PDT not all of the editor-plugins support templates.

is there some generic way of storing code-snippets/templates in eclipse, which will work across all editor-plugins? i think it should be possible to implement such using eclipse monkey -- however, it seems development of monkey was stopped?

i'm using eclipse 3.4.0 btw.

thanks, harald

+2  A: 

If you have the web tools (WTP) plugins installed you should have a Snippets view which is an editor-independent place for collecting reusable code snippets. You can create and place your snippets in there and can separate them using 'drawers'. Double clicking or dragging a snippet item will insert it in the active editor.

The web tools user guide has a section about this view.

Csaba_H
thanks very much!
harald