Before formatting used Jsformat, today on GitHub found a better plug-in Html-css-js prettify, the specific address https://github.com/victorporof/ Sublime-htmlprettify, installing the plugin requires the installation of node. js, as follows:
1. Download node. js, address http://nodejs.org/download (My Computer Win8 64)
Ctrl+shift+p in 2.Sublime, enter IP:
3. Click the install package and search for Html-css-js prettify:
4. After the installation is not normal use, need to set a path, right-click on the page more than a html/css/js prettiy option, set the node path:
Set the following to change the installation path of node according to your operating system
{ //Simply using ' node ' without specifying a path sometimes doesn ' t work:( //Https://github.com/victorporof/Sub Lime-htmlprettify#oh-noez-command-not-found //http://nodejs.org/#download "Node_path": { "Windows": "D:/program Files/nodejs/node.exe", "Linux": "/usr/bin/nodejs", "OSX": "/usr/local/bin/node" }, Automatically format when a file is saved. " Format_on_save ": false, //Only format the selection if there ' s one available. " Format_selection_only ": True, //Log The settings passed to the Prettifier from '. Jsbeautifyrc '. " Print_diagnostics ": true}
Sublime Text2 formatting Hmtl/css/js plugin html-css-js prettify