Sublime Text插件:HTML+CSS+JAVASCRIPT+JSON快速格式化

早期在用EDITPLUS时,分享了关于HTML、CSS、JAVASCRIPT等内容的格式化工具,全体地址为:分享EditPlus快速格式化js/css工具

现在一直在用Sublime Text,遇到需要格式化的javascript、css时,通常还要回到editplus里操作。今天在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

特别提醒:
该插件需要nodejs的支持。
感谢网友lvwker的提醒。

推荐阅读:
Essential Sublime Text 2 Plugins and Extensions
http://code.tutsplus.com/tutorials/essential-sublime-text-2-plugins-and-extensions–net-24173

Sublime Text 使用介绍、全套快捷键及插件推荐
http://www.daqianduan.com/4820.html

16 thoughts on “Sublime Text插件:HTML+CSS+JAVASCRIPT+JSON快速格式化”

    1. 详细您可以参考作者的github库,有更新到3.0的了。地址:https://github.com/victorporof/Sublime-HTMLPrettify

  1. 输入install 调出 Install Package 选项并回车;
    这个输入了没出现这个选项。sublime是3的,这儿下的http://www.sublimetext.com/3

  2. It is in point of fact a great and helpful piece of information. I am satisfied that you just shared this helpful info with us. Please keep us informed like this. Thanks for sharing.

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注