Good looking LaTeX code [duplicate]

I'm looking for some script (program) which would help in editing LaTeX code. Usually I have a mess in my .tex code, so it would be good if the script could align tabulars and so on. It would also be nice, if it allows editing code (for example replace every  with $$...$$ and vice versa).

Is there any program which is doing such a thing? It can be program, or a plugin of texstudio or a bash (python) script as well. However I don want to change my editor (if it is of course possible).

marked as duplicate by Ian Thompson, Sean Allred, user31729, R. Schumacher, Paul GesslerMay 4 '15 at 19:35

• @SeanAllred: For that there's latexindent. – Werner May 4 '15 at 18:49