Currently i am using SublimeText 3 on a Mac but i am unable to 'comment' existing Groovy code. The menu and the shortcut keys do not place the actual '//' comments when i use the menu or the shortcut key. I have searched but i only found solutions to correct this in SublimeText 2. These solutions to copy some Java comments do not work.
Any solution on how Groovy comments can be enabled in SublimeText 3?
These instructions are for OS X, but the same general method applies to any platform.
Go to Sublime Text -> Preferences -> Browse Packages...
to open up the Packages
folder (~/Library/Application Support/Sublime Text 3/Packages
). Create a new folder in Packages
named Groovy
. Next, create a new file in Sublime with XML syntax and the following contents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//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>source.groovy</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
<array>
<dict>
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string>// </string>
</dict>
</array>
</dict>
<key>uuid</key>
<string>D3A56263-A730-4C6E-B8F2-E65FEE21870B</string>
</dict>
</plist>
Save this file as Packages/Groovy/Comments.tmPreferences
. You might get a warning about saving the file with a .xml
suffix, just ignore it and use .tmPreferences
.
And now you should be able to hit ⌘/ and insert comments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With