I\'m writing ANSI-compatible C code, and hence I can\'t use the line (//
) comment. I\'m using Xcode. In Sublime Text and Eclipse, and I think most other IDEs, t
UPDATE: Xcode 8 Update
Now with xcode 8 you can do:
⌥ + ⌘ + /
Note: Below method will not work in xcode version => 8
Very simple steps to add Block Comment functionality to any editor of mac OS X
Add the below applescript in textarea
awk 'BEGIN{print "/*"}{print $0}END{print "*/"}'
Block Comment
Add a keyboard shortcut
Open System Preference > Keyboard > Shortcuts, add new shortcut by clicking +
and right the same name i.e. Block Comment
as you given to applescript in the 4th step. Add your Keyboard Shortcut and click Add button.
Now you should be able to use block comment in Xcode or any other editor, select some text, use your shortcut key to block comment any line of code or right click, the context menu, and the name you gave to this script should show near the bottom.