Development Tips

Some usefull tricks for OSX People.

Changing TextMate's Comment Out Behavior for CSS Scope

Block commenting is very annoying most of the times while writing CSS. It is not working like the other scopes (Python, JavaScript).

As you know, when you comment out a block in CSS it looks like this:

Block commented out CSS Snippet 1
1
2
3
4
5
/*.test {
    border: 1px solid #000;
    color: #f0f;
    margin: 0;
}*/

Pain starts when you want to undo or comment/un-comment quickly. You need to select precisely and need to fix lines and breaks. It is not easy as Python or JavaScript.

I would be better, if i can turn block commenting to this:

Block commented out CSS Snippet 2
1
2
3
4
5
/*.test {*/
/*    border: 1px solid #000;*/
/*    color: #f0f;*/
/*    margin: 0;*/
/*}*/

Open Bundles > Bundle Editor and choose CSS > Comments and add these lines:

{   name = 'TM_COMMENT_MODE';
    value = 'line';
},

TextMate Bundle Editor

Now it turns to this (8

Comments