1 Reply Latest reply: Sep 28, 2014 5:10 PM by Peter Flynn (Adobe) RSS

    Change ctrl shift / from html comment to cfml comment

    wannab0133 Community Member

      Is there a way to make a quick <!--- comment (cfml) rather than a <!-- comment (html) by using shortcuts like ctrl+shift+/    ?

      I am used to adding comments around blocks and lines using keyboard shortcuts or clicking a button on dreamweaver.  Any way to manage these shortcuts?

        • 1. Re: Change ctrl shift / from html comment to cfml comment
          Peter Flynn (Adobe) Adobe Employee

          You can write an extension that defines a new language, maps the .cfml file extension to it, and defines "<!---" as the preferred block-comment style.  (The linked documentation refers to "Brackets," which is just the open-source flavor of Edge Code -- the instructions should work the same for both).  Because Brackets / Edge Code normally treats .cfml as plain HTML, you'll also have to write some code in your extension to remove .cfml from the list of HTML-language file extensions before you can add it to your new CFML language.  Overall, your extension would look something like this:

           

          define(function (require, exports, module) {
              var LanguageManager = brackets.getModule("language/LanguageManager");
              LanguageManager.getLanguage("html").removeFileExtension("cfml");
              LanguageManager.defineLanguage("cfml", {
                  name: "CFML",
                  mode: ["htmlmixed", "text/x-brackets-html"],
                  fileExtensions: ["cfml"],
                  blockComment: ["<!---", "-->"]
              });
          });

           

          Hope that helps!

           

          - Peter