During the design html pages or aspx pages, I like to do the pure coding without Html Designer. The problem is that I like to have the following format on html page for better readability.
<div>
<% if (1 == 1) { %>
Hello
<% } else { %>
World
<% } %>
</div>
As you can guess, whenever you type '}' or ';' or etc, visual studio try to do the auto format and change to the following format
<div>
<% if (1 == 1)
{ %>
Hello
<% }
else
{ %>
World
<% } %>
</div>
The question is "Is it possible to disable auto formatting just only for HTML pages on VS2010? (NOT for C# code, I still like to have auto formatting for C# pages)"
Use w3m -dump <page. html> . It will give you the text representation of the html file.
Enable/Disable Format On SaveOpen up VSCode Command Palette by pressing Ctrl + Shift + P. Search and select Open Settings (UI). Just start typing and it will auto-fill. Once there's a match, you can hit enter immediately, or manually click on the right option.
Languages supported by Prettier: JavaScript, TypeScript, JSX, Angular, Vue, CSS, HTML, JSON, GraphQL, and much more.
TIL how to save a file on VSCode without auto formatting being applied: CMD + K S . This can be useful in situations where one is working in a repository and is not interested in having a big file auto formatted, just for the sake of a trivial change.
Yes, go to these two spots:
Tools > Options > Text Editor > HTML > Tabs > Indenting
Select the None radio button.
Tools > Options > Text Editor > HTML > Tabs > Miscellaneous
Uncheck Format HTML on paste.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With