Need some advanced code indentation help

tmonteit
tmonteit used Ask the Experts™
on
Is anyone aware of a tool or way to reformat entire source code files so that they are readable?

I have some javascript code that is a complete mess.  It is completely unreadable and unworkable.  There are entire methods and loops that are combined into a single line, inconsistent use of white spaces, no indentation, wrong indentation, and downright confusion.  

I'm looking a tool or something that make it readable.  Ideally, no matter now bad or ugly will give me a nice clean workable / readable javascript file that conforms to best coding practices?

I'm using vim on cygwin right now, but I'm no expert.

Suggestions?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011

Commented:
Aaron TomoskyDirector of Solutions Consulting

Commented:
Notepad++ has some tidy functions. They work great for XML and HTML. Never tried on js.
Dreamweaver has a source formatting that tidies everything up.

Or you have

http://jsbeautifier.org/

Which does the same job but for free :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial