How to enable Groovy comments in SublimeText 3 on Mac?

I am currently using SublimeText 3 on Mac, but I cannot comment on existing Groovy code. Menus and keyboard shortcuts do not put the actual "//" comments when I use a menu or keyboard shortcut. I searched, but I found solutions to fix this in SublimeText 2. These solutions to copy some Java comments do not work.

Any decision on how Groovy comments can be included in SublimeText 3?

+7
sublimetext sublimetext3 groovy macos
source share
1 answer

These instructions are for OS X, but the same general method applies to any platform.

Go to Sublime Text -> Preferences -> Browse Packages... to open the Packages folder ( ~/Library/Application Support/Sublime Text 3/Packages ). Create a new folder in Packages named Groovy . Then 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 may receive a warning about saving a file with the suffix .xml , just ignore it and use .tmPreferences .

And now you can press / and insert comments.

+17
source share

All Articles