Beautifying your code basically is to reformat your code to improve readability for a human by following some (user-defined) conventions i.e. re-indenting, splitting the code into lines, adding white spaces at required places to make it easier and faster to read.
A program that improves the presentation of programming source code. Based on an analysis of the syntax, it indents lines appropriately and squashes extraneous blank spaces and lines in order to produce more readable code.
The code formatting is available in Visual Studio Code (VSCode) through the following shortcuts or key combinations: On Windows Shift + Alt + F. On macOS Shift + Option + F. On Linux Ctrl + Shift + I.
Beautify on Save sublime-settings : Ctrl+Shift+P or Cmd+Shift+P in Linux/Windows/OS X.
CSS: code beautifier
HTML: HTML Tidy, CleanUp HTML or the general purpose Pretty Diff
Javascript: http://jsbeautifier.org/
PHP: http://beta.phpformatter.com/
SQL: http://dpriver.com/pp/sqlformat.htm
XML: http://chris.photobooks.com/xml/default.htm
Colour all: http://quickhighlighter.com/
For PHP, Java, C++, C, Perl, JavaScript, CSS you can try:
http://www.prettyprinter.de/index.php
You can use Perl::Tidy for Perl.
JsonLint is good for validating and formatting JSON.
What language?? There are different tools for almost every imaginable programming language, since they all have different syntactic rules and conventions.
Good ol' indent
is a nice, customizable, command-line utility to format C and C++ programs.
It depends of the language, and of the architecture you are using.
For example, in a php platform, you can format almost language with GeSHi
As bluish comments, GeSHi is a generic syntax highlighter, with no beautification feature. It is more used on the server side, and combine it with a beautification tool can be tricky, as illustrated with this GeSHi drupal ticket.
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