Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 2, jsp hidden comment shortcut

In jsp files whenever I hit the CTRL+/ shortcut (on windows) the line is commented with "output comment", that means comments visible in the generated html:

<!-- Output comment -->

I instead want to bind this shortcut with the generation of "hidden comments", that are comments that will not appear in the output:

<%-- Hidden comment --%>

I tried to find where this shortcut is defined but I had no luck.

like image 557
Leonardo Avatar asked Sep 18 '12 12:09

Leonardo


1 Answers

Click on Preferences -> Browse Packages... menu to find the configuration files.

The shortcut are defined in HTML/Comments.tmPreferences. You can change this file to modify the comments of all jsp and html files.

To modify just the jsp comments, create a file named JavaServerPagesComments.tmPreferences in Packages/Java folder with this content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>name</key>
    <string>Comments</string>
    <key>scope</key>
    <string>text.html.jsp</string>
    <key>settings</key>
    <dict>
        <key>shellVariables</key>
        <array>
            <dict>
                <key>name</key>
                <string>TM_COMMENT_START</string>
                <key>value</key>
                <string>&lt;&#37;-- </string>
            </dict>
            <dict>
                <key>name</key>
                <string>TM_COMMENT_END</string>
                <key>value</key>
                <string> --&#37;&gt;</string>
            </dict>
        </array>
    </dict>
    <key>uuid</key>
    <string>54444C7B-54D2-41F6-A817-AEE243C3D45A</string>
</dict>
</plist>
like image 84
messivanio Avatar answered Nov 04 '22 23:11

messivanio