The formatting of HTML and Javascript is just crazy. It actively works against you. Does anybody know how to turn this off pletely? (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).
The formatting of HTML and Javascript is just crazy. It actively works against you. Does anybody know how to turn this off pletely? (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).
Share Improve this question edited Apr 10, 2010 at 13:32 usr asked Apr 10, 2010 at 12:09 usrusr 171k36 gold badges249 silver badges378 bronze badges 1- This is an old post, but I just lost a fight against this JS "feature". I can understand that this auto formatting is the norm, but I built my own flow over 3 decades of coding. The problem occurs when they add these formatting features and turn them on by default. It really pi$$ed me off when--ALL OF A SUDDEN--I couldn't select text in C code and just type a ", <, {, (, or [ without it automatically adding enclosures to what I intended to delete! It's a feature I'd never use. Anyway, thanx for the post:^) – yapdog Commented Jul 1, 2024 at 20:55
3 Answers
Reset to default 9Javascript 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.