atom-beautify: indent html with tabs

3.3k views Asked by At

How can I set the indent size of html to tab in atom-beautifier ? I tried the following in .jscsrc but it doesn't have any effect.

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

There are 2 answers

0
Richard Slater On BEST ANSWER

The atom-beautifier package is deprecated and the author has suggested that users migrate to the atom-beautify package:

Please use: https://atom.io/packages/atom-beautify It's much better :)

The atom-beautify package supports a .jsbeautifyrc to configure the indent size:

{
  "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
}
0
Zamicol On

{ "indent_char": " ", //Tab here. Make sure editor doesn't change it. "indent_size": 1, "indent_with_tabs": true }

I've put this at $ATOMPATH/packages/atom-beautify/.jsbeautifyrc AND $ATOMPATH/packages/atom-beautify/src/.jsbeautifyrc.

atom-beautify is still buggy as heck with tabs. Also make sure that you turn off "soft tabs" in Atom.

Here's a gist of some tips for killing spaces:

https://gist.github.com/zamicol/c5c926500ddde49006122f9e4e52e48f