Allow turning the CSS auto formatting off completly.
There doesn't appear to be a way to turn off the auto formatting in CSS files. I'm sure that in VS2010 my most hit, non-alphanumeric key was the semi-colon, in VS2012 it's backspace 2012 tends to put in spaces and line breaks automatically. I prefer to wrtie my CSS files to be ultra-condensed to begin with. It would be great if there was a "disable auto formatting/auto completion check box for CSS files.
Thanks for the feedback. This option was added to Visual Studio 2013
Visual Studio Web Tools
I came here looking for a possible solution to visual studio formatting my code with a bunch of indents on paste, based on these responses I will stop looking for a solution and just use a different editor.
** regarding last post, i forgot to clarify that this seems to be a problem with inline css - despite my changes to stop HTML formatting, anything inside a <style> tag is still auto-formatted on paste operations (try pasting .classname to line before style rule and see
I couldnt say too much about .css files themselves, no trouble myself of late but im mostly coding inline so i can see changes easily as i load view with ajax
"Thanks for the feedback. This option was added to Visual Studio 2013"
no, it hasnt
like @Aron has stated - it is an INCREADIBLY frustrating bug that you cannot even just simply ctrl-z the formatting step, like i am forced to do for many other flawed 'auto-format' actions when editing certain other languages.
Changing to 'Compact' braces and toggling other options doesnt seem to do a thing.
It was one thing when my cshtml page was quite literally broken in a dozen places when i autoformatted a bunch of files then saved before checking every single tab - that i could stop in future by combing for autoformat options and disabling all i saw
But this is a BUG that STILL exists, despite constant calls and a supposed fix implemented 12 months ago.
I know how to write CSS, stop causing me headaches and screwing up my style sheets every time i paste even a single character
Aron Boyette commented
Despite Mads Kristensen's bold claim that this was implemented, it still does not work. In Visual Studio 2013, under TOOLS - Options, Text Editor / CSS / Advanced, I have Formatting / Automatic formatting = Off. Although nothing is repositioned as I type, whenever I paste, it still repositions. Its VERY aggravating.
By the way, I hope everyone here appreciates the amazing amount of restraint I'm showing in the post. My level of dissatisfaction with Microsoft at this point is making me want to start looking for a Java position.
I can't believe I paid for this ****!! If I want to drop a button into the form, why does that mean I want to make my paragraph look like my heading? This it's actually easier to program all this stuff from notepad. That's a better editor!
I find this irritating as well, but there is a workaround. In case anyone comes across this later like I did...you can simply type the closing brace and then hit Undo (Ctrl+Z) to undo the auto formatting. I do it every day in VS 2012 when working with CSS/LESS files.
Please, please, please provide a "None" option. C'mon, that must be one "if" statement in code somewhere to skip over auto-formatting when the closing brace "}" is typed.
Yes, please, a simple "None" option under TOOLS->OPTIONS->Text Editor->CSS->Formatting would be logical. Choosing "Compact Rules" and unchecking "Hierarchical indentation" does NOT solve the problem. It just formats it differently. It still formats it when I type a closing brace. The only (really lame) workaround I found is to actually keep a closing curly brace copied so that I can paste it in instead of typing it.
Follow TOOLS->OPTIONS->Text Editor->CSS->Formatting
Choose "Compact Rules" and uncheck "Hiearerchical indentation"
Ryan Williams commented
Incredibly irritating. Can't believe an IDE like this doesn't allow the auto-formatting to be disabled. A simple 'None' in the 'Formatting' text editor options would be adequate.
This feature walking through my nerves!
Please just allow turn this off :(
The way I see it is this; How dare Visual Studio force me to format my CSS its way. I've been writing CSS for 10+ years and now Visual Studio has suddenly ruled that my formatting is incorrect and I have to edit EVERY SINGLE LINE OF CSS I WRITE. I dread typing the closing } as it triggers the raping of my code. It's very annoying I can't believe this kind of stuff gets past testing.
Every time my CSS gets reformatted, I curse this misfeature.
It's driving me crazy!! When I'm writing a big chunk of CSS I write it in another app and copy it over.
Can't believe there is no way to turn this off?!?
Yes please implement this.
Absolutely. Please implement this.