tags:

views:

60

answers:

1

Hi,

My textmate suddenly stopped recognizing comments in code and the shortcut for commenting out code (Command + /).

I have found Comments in the Bundle Editor for HTML, but it doesn't look like I can set an activation key for it or anything.

Does anyone have any experience with this part of TextMate?

cheers!

+1  A: 

Maybe it went out of scope? Doesn't matter what caused it, it's easy enough to fix.

  • Open your Bundle Editor (ctrl-option-cmd-B)

  • Make sure that the Menu button at the top left-hand side of the Bundle Editor displays "Show All"

  • If it doesn't then click the up/down arrow and change it so that does

  • Scroll down until you find the "Source" bundle

  • Click the arrow to the left of "Source" to display the Bundle contents

  • looking at the Source Bundle items with green "C"s next to them, find the item called "Comment Line/Selection"

  • Click "Comment Line/Selection"

  • In the upper right-hand corner of the Bundle Editor, click the "Settings" button

  • Next to "Activation", select the menu item "Key Equivalent"

  • Whatever is in the text box to the right, replace it with "cmd-/" (with your cursor in the text field, press the keys "cmd" and then "forward slash"

  • Verify that the item "Scope Selector" text area is blank--nothing should be in there

  • Exit the Bundle Editor, Restart TextMate, open a new editor window (cmd-N) then enter "cmd-/" to verify that it's working

This command is not limited by scope so it will work in any context/environment/language, but because it is not limited by scope it can be overridden by a Bundle-specific comment command (e.g., a comment command in the HTML Bundle, so, if after you've followed those steps, it's still not working, you just need to find that Bundle-specific comment command and either fix it (using the steps above as a template) or then use the steps above as a template) or deleting it.

While you're at it, you might as well fix the command in your HTML Bundle. From your Bundle Editor, scroll down to the HTML Bundle then click on the Comment item (you said in your Q, you had located it). Click the "Settings" button on the upper right-hand corner, and verify that "Activation" is "Key Equivalent" and "cmd-/" is in the adjacent text box. Next verify that "Scope Selector" is "text.html"

doug
awesome! thanks for the detailed walk through. Turns out my Source Bundle was filtered, which was easy to figure out after following your instructions.Thanks!
gleddy
no problem, glad it helped--please accept the answer when you get a chance.
doug