In TextMate 2.0.19
you can comment, or uncomment, a line or selection with the shortcut Cmd (⌘) + /
.
If this shortcut doesn't work for you, you can do it like this :
- Select
Bundles
in the menu bar
- Select
Source
- Select
Comments
- Select
Comment line
Happy coding
TIPS
Define a new shortcut for comment or uncomment
If the native shortcut doesn't work for you, define a new one like this :
- Select
Bundles
in the menu bar
- Select
Edit Bundles...
- Select
Source
- Select
Menu Actions
- Select
Comments
- Select
Comment Line / Selection
- Click on
Key Equivalent
- Type your shortcut
- Close the Bundles editor
- A prompt will ask you to confirm your changes
- Test it!
Others useful shortcuts
- Insert Block Comment :
Option (Alt, ⌥) + Cmd (⌘) + /
- Insert Comment Banner: Select the word or text you want to use as a banner and
Ctrl (⌃) + Shift (⇧) + B
- Insert Comment Header ( This will insert the name of the script and some useful details): You have to define it because in my case it was empty... I defined it with
Ctrl (⌃) + Shift (⇧) + N
Use Help in TextMate
- Select
Help
in the menu bar
- type "comment"
This will brings you directly to the option comment line
. I suggest doing that first because in most cases, you will find the answer.