Question

I need to disable the CSS auto format in Visual Studio 11. It simply drives me nuts, it's horrible. I remember in version 2010 there was an option to disable auto formatting for any language, but now I can't find it anymore. Whenever I write a line and press enter it messes up my code.

The most appropriate formatting style is the Compact rules style, but it adds a space after the colon, and also it puts the opening bracket immediately after the selector (I align all brackets to a common column).

Was it helpful?

Solution

It doesn't look like there's an option. I checked through the registry settings being accessed and couldn't see anything there for it either.

I'd suggest you raise an issue on the connect site or add an entry to the Visual Studio User Voice site.

OTHER TIPS

So far in the RC there is only the compact as you pointed out, the tab is annoying but at least it stops putting the braces below the class.

One way around this (using Visual Studio 2010) is not to use the HTML editor. Rather, choose Open With... and go with the Source Code Editor instead. Doing this the only thing it seems to be missing (well aside from the split and design views) is syntax coloring for CSS. HTML is still syntax colored, and Intellisense still seems to work for both CSS and HTML.

Also, this is something that they have fixed for VS2013:

https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3549819-allow-turning-the-css-auto-formatting-off-completl

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top