Sublime Forum

Don’t include indent in comment in CSS

#1

When I comment a line in CSS, I get this

.example {
/*    color: red; */
}

instead of this

.example {
    /* color: red; */
}

How do I get the first behavior?

Besides appearance, this is annoying because it breaks auto-indentation on the line following the commented one.

0 Likes

#2

You can override the tmPreferences file where it sets this behavior:

1 Like

#3

Thank you, this did what I wanted.

In case this is read by anybody like me who isn’t sure how to create this override, I just created a file Packages/User/Comments.tmPreferences with the following content.

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
	<key>scope</key>
	<string>source.css</string>
	<key>settings</key>
	<dict>
		<key>shellVariables</key>
		<array>
			<dict>
				<key>name</key>
				<string>TM_COMMENT_DISABLE_INDENT</string>
				<key>value</key>
				<string>no</string>
			</dict>
		</array>
	</dict>
</dict>
</plist>
0 Likes