返回列表

修改Sublime中JsFormat关于缩进的配置

默认分类 2014/05/31 07:58

想修改一下Sublime中JsFormat关于缩进的配置, 先是看了下面这个地址 https://github.com/jdc0589/JsFormat 只找到一个 indent_with_tabs: false 改了下, 发现不能改变缩进几个空格, 看到上面写了

translate_tabs_to_spaces: true,
tab_size: 4

于是加到了Sublime Text 2\Packages\User\JsFormat.sublime-settings中, 发现还是没效果, 又搜了半天,还是没找到解决方法, 于是又回到https://github.com/jdc0589/JsFormat 看到

The following JsBeautifier settings are available in JsFormat/JsFormat.sublime-settings (defaults shown below). Check out the official jsbeautifier documentation for more details on the options:

于是顺手点了过去https://github.com/einars/js-beautify#options, 看到上面有indent-size, 于是改了一下加到了JsFormat.sublime-settings, 成功生效!

{
    // exposed jsbeautifier options
    "indent_with_tabs": false,
    "indent_size": 8,
    "translate_tabs_to_spaces": true
}