How to disable crazy Javascript/HTML formatting in Visual Studio 2008?
The formatting of HTML and Javascript开发者_如何学运维 is just crazy. It actively works against you. Does anybody know how to turn this off completely? (I Do not speak about the HTML designer, I speak about what happens when you press ctrl-k,d in HTML view or when you press ; in a javascript block).
Javascript formatting can be disabled in Tools → Options → Text Editor → JScript → Formatting.
Goto Tools -> options -> Text Editor -> HTML and set option as per requirement.
See following for more details:
Turn off auto formatting in Visual Studio
How do I turn off Visual Studio's formatting options?
The crazy formatting is called 'K&R style bracketing', you can read about it if you search for that term.
Michael's answer is good, but it can be refined a little:
Javascript formatting can be disabled in Tools → Options → Text Editor → JScript → Formatting -> new lines -> 'Place open brace on new line for functions and classes', check to remove K&R style formatting.
You might want to change it a few other places too, such as css: Tools → Options → Text Editor → CSS -> Advanced -> formatting -> brace positions, set to 'Expanded' to remove K&R style formatting.
精彩评论