Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable CSS auto-format in Visual Studio (particularly 11)

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).

like image 532
Tiborg Avatar asked Nov 28 '11 21:11

Tiborg


People also ask

How do I disable beautify VS Code?

Every single IDE makes this incredibly difficult. Use vs-code default shortcut keys ctrl+k with ctrl+shift+s (windows) for saving without formatting. Alternatively press ctrl+shift+p and search for save without formatting.

How do I beautify CSS in Visual Studio?

press F1 or ctrl+shift+p and then enter beautify .. alt+shift+f did nothing, but typing beautify...


2 Answers

Here is how with SCSS. I belive it will be a similar process with CSS.

In my case I am using Asterisk AEL which is a custom script from Asterisk. Ael looks like this https://wiki.asterisk.org/wiki/display/AST/AEL+Loops

Anyways I first had to format .ael file extension as SCSS by going to Options then searching for file extensions.

enter image description here

Because AEL code is not SCSS I then searched for SCSS on options and disabled mostly everything as:

enter image description here

Now visual studio will not mark errors and will still format the code.

like image 84
Tono Nam Avatar answered Oct 09 '22 08:10

Tono Nam


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.

like image 31
Richard Banks Avatar answered Oct 09 '22 07:10

Richard Banks