简体   繁体   中英

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

可以在工具→选项→文本编辑器→JScript→格式化中禁用Javascript格式。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM