Apr
18

My CFEclipse Snippets

Posted by Aaron West at 2:14 PM in ColdFusion

I'm continually adding and editing my CFEclipse Snippets in an effort to be as productive as possible. After adding a few new ones today I thought I'd offer them up for download. The download includes snippets for several ColdFusion tags including cfcomponent and cffunction as well as snippets for comment headers, an HTML skeleton, and more. Most of them are "smart" snippets illustrating how you can provide pop-up menus allowing you to choose how the snippet will place code on your page. Pretty cool stuff. By no means are my snippets an exhaustive list and I welcome suggestions from other seasoned CFEclipse guru's.

Installation instructions:

  1. Download the zip file.
  2. Extract the contents of the zip file to your snippets directory. Your CFEclipse snippets directory is located in the CFEclipse plugin folder (com.rohanclan.cfml) which is located wherever you are storing your workspace. For your convenience, the snippets will be placed in a new folder (snippets_aaron) so you don't overwrite anything. This will allow you to play around with them and use what you like and delete what you don't like.
  3. Refresh the "Snip Tree View" using the menu in the Snippets panel.
  4. If step 3 doesn't make the "snippets_aaron" folder appear, try restarting Eclipse.

Aaron West's Gravatar
About this post:

This entry was posted by Aaron West on April 18, 2006 at 2:14 PM. It was filed in the following categories: ColdFusion. It has been viewed 21189 times and has 15 comments.

15 Responses to My CFEclipse Snippets

  1. Richard Davies

    Thanks for sharing these. I've just discovered this functionality in CFEclipse so these will help me a lot.

  2. Glad they will be of help Richard.

  3. Alfio Raymond

    I was having some issues with your snippets showing up. I installed them in Applications/eclipse/plugins/org.cfeclipse.cfml_1.3.1.6/snippets on my mac and clicked refreshed and restarted eclipse but nothing.
    Also tried installing coldBox snippets but no luck with that either.

  4. @Alfio - I've noticed on some machines refreshing the Snip Tree View and restarting Eclipse does not help. In these situations restarting Eclipse with the "-clean" option seems to do the trick. Just add that command to your shortcut on Windows or your alias on Mac.

  5. Gary Ridner

    I thing the reason Alfio was having a problem with snippets was the same problem I initially had. The default folder that my snippets were set to show up in was, at least in Windows, was the /inetpub/wwwroot/workspace/.metadata/.plugins/org.cfeclispe.cfml/snippets folder. The folder that Alfio was referring to is in appears to be one installed when you install the CFEclipse plug-ins. You can either move or copy the snippets from this /eclipse folder into the /.workspace folder, and then add Aaron's, or you can use the Eclipse Windows->Preferences... dialog and click on CFEclipse, then set the folder to use for Snippets to some other location than the default /.workspace directory.

  6. @Gary - Actually I set up my worspace folder in my documents folder on my mac and after going thru a bit realized that the folders were hidden so just had to allow permission to view and write to the folder. I started out by just opening Aarons snippets and creating them myself in Eclipse and then did a search for them with finder.

    @Aaron - Where can I read up more on creating snippets with the dynamic data you have in your snippets as I find them extremely useful in cutting down my deveopment time? (ie. $${DATE})

  7. dc

    Having similar issues on the mac regarding the files in workspace being visible to enter snippets .
    Any solutions adam ?
    Not a permmisions issue .
    Perhaps driver , perhaps .

  8. @dc - I'm not sure what you mean by files being "visible in the workspace." Are you saying you can't create snippets? Are you having trouble inserting snippets into your code? Help me out here.

  9. kobi

    thanks for sharing and usefull information.good work

  10. Suzanne

    Very specific information on which directory to install snippets available at

    http://www.adobe.com/devnet/coldfusion/articles/ec...

    with kudos to aaron. Thank you!

  11. @dc - I too had issues figuring out how to install Snippets on the Mac version of Eclipse. The link that Suzanne posted from Adobe's Website was actually the source of my confusion since the author, Roman Villareal, only posted instructions on how to get it working on Windows.

    Gary suggested a great workaround. You can go into your CFEclipse preferences and change the default location of your CFEclipse snippets. This will allow you to choose a folder that's visible in Finder.

    I actually went about another route. I found this small Mac utility on VersionTracker that makes all invisible files and folders visible.

    Visibility
    http://www.versiontracker.com/dyn/moreinfo/macosx/...

    There's plenty other apps like this. This is just the first one I found.

    Once you can view invisible folders, go to your Eclipse workspace folder and go to

    .metadata\.plug-ins\org.cfeclipse.cfml\snippets

    After I did this, I refreshed the Snip Tree in Eclipse, and Aaron's snippets showed up like cake.

    @Aaron - I started to make the transition away from Dreamweaver yesterday, so this is my first time trying out your snippets (or any snippets for that matter). Can't wait to check 'em out.

  12. @Jose - I don't recommend changing your default snippets directory in Eclipse as there are better ways to see the hidden files in the snippets directory.

    I haven't tried the tool you found on VersionTracker as I wrote my own AppleScript utility that sits in the Menu bar waiting to be used. I simply run the AppleScript to toggle hidden files to "viewable" and do what I need to in hidden directories. When finished, I just toggle hidden files back to normal. For more info on this utility search my blog for "ToggleHiddenFiles."

  13. Thanks for sharing these! I had been using Dreamweaver as my IDE since moving to ColdFusion, and had been generally happy. As I've matured as a CF developer and as my latest version of Dreamweaver became more buggy, I started working in Eclipse. I tried several configurations and had mixed results. This was seriously cramping my productivity, but I have finally got a good setup going on my MacBook Pro using Eclipse 3.4.2 + the new CF Builder plugins (I did not have a good experience with the stand alone version of CF Builder, besides I like the new universe Eclipse has opened up for me).

    I only discovered "snippits" tonight and figured some CF genius out there must have posted some good ones. I found yours. ;) Using yours as guides, I was able to write my own time-saving snippets and I'm oh-so-happy. Thanks again!

  14. @Kevin - You're welcome! I'm glad you found them useful!

  15. Jochen

    Hi Aaron,
    thank you very much. Your snippets are great.