Make a Dreamweaver shortcut to add ColdFusion comment tags
Don’t hold it against me, but I like to use Dreamweaver to code ColdFusion. However, like most people I have some gripes. For instance, I really want a shortcut to comment out ColdFusion code. There’s just two problems with this…
By default Dreamweaver doesn’t have a shortcut key to insert comments.
Dreamweaver inserts HTML comments (<!– –>), not ColdFusion comments (<!— —>).
Here’s how to fix both problems:By default Dreamweaver doesn’t have a shortcut key to insert comments.You can easily edit short cut keys in Dreamweaver. Simply click Edit > Keyboard Shortcuts… This will open the Keyboard shortcuts window. With Menu Commands selected in the Commands dropdown expand the Insert and then Text Objects tree items. Select Comment at the bottom of the list. Select the Press Key textbox and hit whatever shortcut keys you want. I use CTRL-ALT-C.Now, whenever you want to add a comment simply hit your chosen shortcut and Dreamweaver will wrap your selection in comment tags!And that leads us to the second problem… Dreamweaver inserts HTML comments (<!– –>), not ColdFusion comments (<!— —>).After much digging around and guessing in the Dreamweaver configuration directory I found a file which can be used to change the default comment formatting. The file can be found under [yourDreamweaverInstallDirectory]ConfigurationObjectsTextComment.js.Shutdown Dreamweaver and open the Comments.js file. Find the line which reads:dom.source.wrapSelection('<!-- ',' -->');Change this line to read:dom.source.wrapSelection('<!--- ',' --->');Now, when you restart Dreamweaver your shortcut key will wrap you current selection in wonderful ColdFusion comments. One less Dreamweaver headache!
Nov 15
How to make a Dreamweaver shortcut to add ColdFusion comment tags
by Brian Fleishman
In: Servers
No comments
Make a Dreamweaver shortcut to add ColdFusion comment tags
Don’t hold it against me, but I like to use Dreamweaver to code ColdFusion. However, like most people I have some gripes. For instance, I really want a shortcut to comment out ColdFusion code. There’s just two problems with this…
Here’s how to fix both problems:By default Dreamweaver doesn’t have a shortcut key to insert comments.You can easily edit short cut keys in Dreamweaver. Simply click Edit > Keyboard Shortcuts… This will open the Keyboard shortcuts window. With Menu Commands selected in the Commands dropdown expand the Insert and then Text Objects tree items. Select Comment at the bottom of the list. Select the Press Key textbox and hit whatever shortcut keys you want. I use CTRL-ALT-C.Now, whenever you want to add a comment simply hit your chosen shortcut and Dreamweaver will wrap your selection in comment tags!And that leads us to the second problem… Dreamweaver inserts HTML comments (<!– –>), not ColdFusion comments (<!— —>).After much digging around and guessing in the Dreamweaver configuration directory I found a file which can be used to change the default comment formatting. The file can be found under [yourDreamweaverInstallDirectory]ConfigurationObjectsTextComment.js.Shutdown Dreamweaver and open the Comments.js file. Find the line which reads:
dom.source.wrapSelection('<!-- ',' -->');Change this line to read:dom.source.wrapSelection('<!--- ',' --->');Now, when you restart Dreamweaver your shortcut key will wrap you current selection in wonderful ColdFusion comments. One less Dreamweaver headache!Tags: cold fusion, comment tags, dreamweaver shortcut