• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

TeraTech

The ColdFusion Experts: Develop | Secure | Optimize

  • Services
    • Consulting
    • Crash
    • Development
    • Maintenance
    • Modernization
    • Security
  • About Us
  • Testimonials
  • Free Assessment
  • Get in touch!

  • Services
    • Consulting
    • Crash
    • Development
    • Maintenance
    • Modernization
    • Security
  • About Us
  • Testimonials
  • Free Assessment
  • Get in touch!

What is CFeclipse Snippets and How to Use It?

November 28, 2023 By Michaela Light Leave a Comment

CFeclipse Snippets

As a programmer you find many times with the need to write the same code again and again for each component or file, or within the same file when defining functions, for example, all have the same format or syntax, you can copy and paste but there are ways More convenient like Snippets, which are stored predefined code blocks which can be inserted with some combinations of characters predefined by the user in conjunction with key combinations or shortcuts; Many IDE's have this function and Eclipse is not far behind for example whenever I want to insert the definition of a function write the word function and then press the keys ctrl + j, this opens a window with fields like name, displayname, hint , ReturnType, access; Once the fields are filled I press OK and I get the definition of a function ready to start with the code of the body of this one.

Let's for example to create a snippet to insert the init function that is occupied in all components as the object constructor, if you are using Object Oriented Programming, if you do not use it, you should.

To define a variable, which will be converted to a field in the window that needs to be filled at the time of inserting the snippet, is used $$ {Setting: variable not found}; Then the snippet would be defined as follows:

*Note. This is my way of defining and documenting functions is not a rule but you can take it as an example

 

/**

*@Displayname $${Setting: displaname not found}

* $${Setting: hint not found}

*

**/

 

$${Setting: access:private|public|remote not found} $${Setting: returntype:any|array|boolean|numeric|struct|void not found} function $${Setting: name not found}(){

 

   return;

}

 

In the previous example we find something like this: {setting: access | private | public | remote not found} with this we are indicating that the variable access can have the following values private, public, remote then at the time of inserting the snippet, Eclipse Will show a drop-down list with these options in the window, but if you need to write something different to any of these options you can do so.

 

Eclipse allows you to organize snippets into packages so you can group them by language, functionality or as you see fit.

Steps to Create a CFeclipse Snippet

  1. Show the snippets panel, in the default perspective of CFeclipse, can be found in the left toolbar or in the main menu Window – Show view – Snip Tree View
  2. Click on the New snippet icon
  3. Write the name of the snippet (Snippet name)
  4. Write the text that will trigger the insertion of the snippet (trigger text), to insert a snippet can be from the corresponding panel, or typing the trigger text and pressing the keys ctrl + j
  5. In the window, two text areas are offered for the body of the snippet, this is because in markup languages an opening tag and a closing tag are occupied, then when a snippet is created using the two fields, at the time of insertion, Text that is selected will be enclosed by first inserting the first block (starting block), and then the second (closing block), for functions for example only the first field (starting block) will be used.

Steps to insert a CFeclipse snippet

First Method

  1. Position the cursor in the place where you want to insert the snippet.
  2. Locate the snippet in the panel and click on it to select it.
  3. Click on the Insert snippet icon

Second method

  1. Position the cursor in the place where you want to insert the snippet
  2. Write the trigger text corresponding to the snippet at the time of creating it and press ctrl + j the trigger text is case sensitive, if no variable was defined in the snippet, the snippet body text will be inserted, otherwise a window will appear for Write the corresponding variables.

If you want to backup your snippets, share them, or add someone else's, just copy the files to or from the following path <workspacelocation> /workspace/.metadata/.plugins/org.cfeclipse.cfml/snippets; There you will find XML files organized in folders that are the packages that you created. By default the <workspace location> path is /users/[username]/documents/

Remember that the workspace was defined the first time you ran Eclipse, or whenever you open it, if you did not activate the Always use this path.

Download some Snippets here.

Links of Interest for CFeclipse

Https://github.com/cfeclipse/CFEclipse/wiki/code-snippets

 

 

  • Facebook
  • Twitter
  • LinkedIn

Related Posts

  • CFEclipse Cheatsheet
  • CFEclipse 1.3 Update – Part II
  • CFEclipse 1.3 Update – Part I

Filed Under: CFEclipse

← Previous Post 027 State of CF Union Survey 2017 pt.2, with Brad Wood – Transcript
Next Post → 123 State of CF Union Survey Analysis (part 2) with Gavin Pickin

Primary Sidebar

Popular podcast episodes

  • Revealing ColdFusion 2021 – Rakshith Naresh
  • CF and Angular – Nolan Erck
  • Migrating legacy CFML – Nolan Erck
  • Adobe API manager – Brian Sappey
  • Improve your CFML code – Kai Koenig

CF Alive Best Practices Checklist

Modern ColdFusion development best practices that reduce stress, inefficiency, project lifecycle costs while simultaneously increasing project velocity and innovation.

Get your checklist

Top articles

  • CF Hosting (independent guide)
  • What is Adobe ColdFusion
  • Is Lucee CFML now better than ACF?
  • Is CF dead?
  • Learn CF (comprehensive list of resources)

Recent Posts

  • 141 Into The Box 2025 ColdFusion conference (all the details) with Daniel Garcia – Transcript
  • 141 Into The Box 2025 ColdFusion conference (all the details) with Daniel Garcia
  • 107 ColdFusion 2021 Revealing Details on How it was Created with Rakshith Naresh
  • The Legacy Continues: ColdFusion Summit East Conference Edition
  • 140 BoxLang modern JVM language that runs CFML code (new CFML engine and much more) with Luis Majano and Brad Wood – Transcript

Categories

  • Adobe ColdFusion 11 and older
  • Adobe ColdFusion 2018
  • Adobe ColdFusion 2020 Beta
  • Adobe ColdFusion 2021
  • Adobe ColdFusion 2023
  • Adobe ColdFusion 2024
  • Adobe ColdFusion 2025
  • Adobe ColdFusion Developer week
  • Adobe ColdFusion Project Stratus
  • Adobe ColdFusion Summit
  • AWS
  • BoxLang
  • CF Alive
  • CF Alive Podcast
  • CF Camp
  • CF Tags
  • CF Vs. Other Languages
  • CFEclipse
  • CFML
  • CFML Open- Source
  • CFUnited
  • ColdBox
  • ColdFusion and other news
  • ColdFusion Community
  • ColdFusion Conference
  • ColdFusion Consulting
  • ColdFusion Developer
  • ColdFusion Development
  • ColdFusion Hosting
  • ColdFusion Maintenance
  • ColdFusion Performance Tuning
  • ColdFusion Projects
  • ColdFusion Roadmap
  • ColdFusion Security
  • ColdFusion Training
  • ColdFusion's AI
  • CommandBox
  • Docker
  • Fixinator
  • Frameworks
  • Fusebox
  • FusionReactor
  • IntoTheBox Conference
  • Java
  • JavaScript
  • JVM
  • Learn CFML
  • Learn ColdFusion
  • Legacy Code
  • Load Testing
  • Lucee
  • Mindmapping
  • MockBox
  • Modernize ColdFusion
  • Ortus Developer Week
  • Ortus Roadshow
  • Server Crash
  • Server Software
  • Server Tuning
  • SQL
  • Survey
  • Survey results
  • TestBox
  • Transcript
  • Webinar
  • Women in Tech

TeraTech

  • About Us
  • Contact

Services

  • Free assessment
  • Consulting
  • Crash
  • Development
  • Maintenance
  • Modernization
  • Security
  • Case Studies

Resources

  • CF Alive Book
  • CF Alive Podcast
    • Podcast Guest Schedule
  • TeraTech Blog
  • CF Alive resources
  • CF e-course
  • CF best practice checklist

Community

  • CF Alive
  • CF Inner Circle
  • CF Facebook Group

TeraTech Inc
451 Hungerford Drive Suite 119
Rockville, MD 20850

Tel : +1 (301) 424 3903
Fax: +1 (301) 762 8185

Follow us on Facebook Follow us on LinkedIn Follow us on Twitter Follow us on Pinterest Follow us on YouTube



Copyright © 1998–2025 TeraTech Inc. All rights Reserved. Privacy Policy.