When I select a line in Textmate and do the shortcut for comment line (command-L on Mac), it uses C-style comments (ie. /* ... */). How do I change it to use C++ style comments (ie. // ...). I am editing Javascript if that makes a difference. Thanks.
+1
A:
First, in an open TM file, go to the control bar (at the very bottom), click the icon with an upper-case "L" in a gray circle (the Language icon), then select the language (javascript) from the pop-up that appears after you click.
(After you've done this, you should see "javascript" just to the left of the language icon.)
Once you've done that "cmd-/" (command + forward slash) will give you the language-appropriate comment symbol.
doug
2010-02-18 02:09:05
This is pretty much it, though I wanted to stay in Javascript mode. It turns out there are two Javascript modes--one that uses /* ... */ and one that uses //.
Sam Lee
2010-02-18 07:14:38
Thanks--i inadvertently picked up "C++" from the text of your question; i've amended my answer by replacing "c++" w/ "javascript" though. Having done that, the answer is identical. In the javascript bundle only the comment symbol "//" is in the language grammar, the other type is not, perhaps because (as i'm sure you're aware) it's can easily occur in regular expression literals and so the first type is the most often used.
doug
2010-02-18 09:11:50