今天在github上乱逛,无意间找到victorporof分享的htmlpretty插件,特做推荐;
先看看他是怎么描述htmlpretty的:
This is a Sublime Text 2 and 3 plugin allowing you to format your HTML, CSS, JavaScript and JSON code. It uses a set of nice beautifier scripts made by Einar Lielmanis. The formatters are written in JavaScript, so you’ll need something (node.js) to interpret JavaScript code outside the browser.
This will work with either HTML, CSS, JavaScript and JSON files.
经过安装后测试,效果很棒,安装过程简要说明如下:
- 在Sublime Text中,按下Ctrl+Shift+P调出命令面板;
- 输入install 调出 Install Package 选项并回车;
- 输入pretty,并在列表中选择HTML-CSS-JS Prettify后回车即可安装
快捷使用方法:
举例:
打开一个压缩的jquery.min.js文件,按下Ctrl+Shift+H
原处:http://jokerliang.com/html-css-javascript-and-json-code-formatter-for-sublime-text-2-and-3.html