【发布时间】:2016-09-09 06:30:56
【问题描述】:
如何在 atom-beautifier 中将 html 的缩进大小设置为制表符? 我在 .jscsrc 中尝试了以下内容,但没有任何效果。
{
"html": {
"indent_char": " ",
"indent_size": 1,
"indent_with_tabs": true
}
}
【问题讨论】:
如何在 atom-beautifier 中将 html 的缩进大小设置为制表符? 我在 .jscsrc 中尝试了以下内容,但没有任何效果。
{
"html": {
"indent_char": " ",
"indent_size": 1,
"indent_with_tabs": true
}
}
【问题讨论】:
atom-beautifier 包已弃用,作者建议用户迁移到atom-beautify package:
atom-beautify 包支持.jsbeautifyrc 来配置缩进大小:
{
"indent_size": 2,
"indent_char": " ",
"other": " ",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"jslint_happy": true,
"indent_handlebars": true
}
【讨论】:
{
"indent_char": " ", //Tab here. Make sure editor doesn't change it.
"indent_size": 1,
"indent_with_tabs": true
}
我把它放在$ATOMPATH/packages/atom-beautify/.jsbeautifyrc 和$ATOMPATH/packages/atom-beautify/src/.jsbeautifyrc。
atom-beautify 仍然存在与标签一样的问题。还要确保关闭 Atom 中的“软标签”。
这里有一些杀死空格的技巧:
https://gist.github.com/zamicol/c5c926500ddde49006122f9e4e52e48f
【讨论】: