【问题标题】:atom-beautify: indent html with tabsatom-beautify:使用制表符缩进 html
【发布时间】:2016-09-09 06:30:56
【问题描述】:

如何在 atom-beautifier 中将 html 的缩进大小设置为制表符? 我在 .jscsrc 中尝试了以下内容,但没有任何效果。

{
  "html": {
    "indent_char": "    ",
    "indent_size": 1,
    "indent_with_tabs": true
  }
}

【问题讨论】:

    标签: atom-editor atom-beautify


    【解决方案1】:

    atom-beautifier 包已弃用,作者建议用户迁移到atom-beautify package

    请使用:https://atom.io/packages/atom-beautify 更好:)

    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
    }
    

    【讨论】:

      【解决方案2】:

      { "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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-02-11
        • 1970-01-01
        • 2018-08-22
        • 2018-01-08
        • 2020-08-11
        • 1970-01-01
        • 1970-01-01
        • 2015-09-17
        相关资源
        最近更新 更多