Is it possible to add auto indentation for code.
For example:
do
{
for(;true;)
{
}
}while(true);
The nested scope isn't auto indented. I have to do it manually. Is it possible to add the feature or it exists already?
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.
Sign up to join this communityIs it possible to add auto indentation for code.
For example:
do
{
for(;true;)
{
}
}while(true);
The nested scope isn't auto indented. I have to do it manually. Is it possible to add the feature or it exists already?
It is hard enough to find a library that will tidy up HTML, then you need to prettify JS within HTML files, and on top of that CSS. That's only considering core web development.
Then you have SQL formatting, C#, VB.net, *nix scripts, dos batch files, Delphi, Haskell, Perl, Python, Smalltalk, Ruby...
Each with its own language specification. For some languages, the formatting itself defines code blocks (begin-end), so you really don't want to guess on those ones.
Even if you can find a good formatter for EVERY SINGLE LANGUAGE StackOverflow1 supports (and that means all and sundry under the sun), can you even get developers to like the implicit formatting rules imposed by SE?
1 That is without even considering all the other sites on the SE2 sites that share the same engine
Here is a customized version of jsbeautifier's userscript, that does your example code from,
To