Sublime Text 2 and ColdFusion
Update: 1/2012 - The ColdFusion package should now be available in the excellent Sublime Text Package Manager and is the easiest way to get started with ColdFusion in Sublime Text 2. It’s also available on github: https://github.com/SublimeText/ColdFusion
Someone on Twitter recently mentioned the Sublime Text editor and I’ve been trying it out for the last week or so. Currently I’ve been switching between Gedit (Linux) and Notepad++ (Windows). Sublime Text runs on both so that is a huge benefit for me.
Next question - can you write CFML with it… Doing a quick Google search turns up two solutions:
I went with Justin’s solution for no other reason than it was the first one I hit. It took me a few minutes to figure out how to ‘install’ this but it’s a few simple steps (there might be an easier way to do this but it worked for me)
- Download .zip file from github
- You’ll end up with a ColdFusion.sublime-package file
- Rename this to ColdFusion.sublime-package.zip and unzip that
- Rename the parent directory to just ‘ColdFusion’
- Then copy this to where your Sublime editor has it’s other language files. On Windows for me this was: C:\Users\jim\AppData\Roaming\Sublime Text 2\Packages\ColdFusion
Crank open a .cfm page and you should see the language switch to ColdFusion and get some basic color coding.
You can explore some of the tags in the unzipped package. I’m still learning my way around Sublime but it appears it supports some ‘auto complete’ like features…
In a .cfm file type ‘cfargument’. Don’t include the opening ‘<’
Immediately after the last letter hit the TAB key. This will add the opening and closing ‘<>’ and fill in the available options.
:::cfm <cfargument name="" type="" required="" default="" displayname="" hint="" />
Subsequent TAB presses will cycle through each attribute. You can easily delete them or fill in their values.
It appears you can also write your own snippets - check out Indy’s download for examples of user defined snippets for ColdFusion.
If you try Sublime please post your comments below - I would love to learn more tips and tricks about this editor.
Update: I’ve setup a wiki page to track Sublime resources (esp those related to CFML).