本文共 909 字,大约阅读时间需要 3 分钟。
一、Sublime Text插件之HTML-CSS-JS Prettify
说明:如果仅是对HTML、CSS、JS进行格式化显示的话‘HTML-CSS-JS Prettify’插件比‘CodeFormatter’要好一些。
关于CodeFormatter:
注:
1.改插件格式化不是所有的标记都换行,然而在CodeFormatter中是这样
2.改插件格式化时候,对于同一行内多个空格,自动处理成一个空格
html格式化实例:
二、相关整理:
GitHub源代码地址:
Package Control地址:
三、使用步骤
1.下载插件,解压到:根目录/Data/Packages 中
2.配置关联
{ // Simply using `node` without specifying a path sometimes doesn't work :( // https://github.com/victorporof/Sublime-HTMLPrettify#oh-noez-command-not-found // http://nodejs.org/#download "node_path": { "windows": "C:/Program Files/nodejs/node.exe", "linux": "/usr/bin/nodejs", "osx": "/usr/local/bin/node" }, // Automatically format when a file is saved. "format_on_save": true, // 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}
3.配置格式化参数,目前使用感觉使用默认就可以。
更多: