2016-11-12 50 views
0

我浏览过网页3次,但仍然没有解决方案。崇高3个选项卡和空格不匹配

我有一个简单的js文件,我想我的标签是4个空格,而不是2

我改变了偏好设置,标签大小为4,chaged语法特定的设置,一切,但仍然相同问题。

有什么想法?

+0

当我刚刚将''translate_tabs_to_spaces“''更改为'true'后,我按下一个选项卡后,我添加了4个空格。 –

+0

做到了:/不工作 –

+0

这是一个已经存在的文件吗?有一个默认为'true'的设置,它使崇高的检测当前文件的缩进并改为使用该信息。 – OdatNurd

回答

2

单击状态栏上的缩进信息,即Tab Size: numSpaces: num的位置,将显示上下文菜单。

Image of ST Status Bar

使用用空格缩进和2的宽度假设的文件的开始位置,按照下面的过程转换为用空格缩进和4

转换到一个宽度从空间标签,改变宽度,然后再转换回空间,就像这样:

  • 取消选中:Indent Using Spaces
  • 点击:Convert Indentation to Tabs
  • 蜱:Tab Width: 4
  • 蜱:Indent Using Spaces
  • 点击:Convert Indentation to Spaces
  • 就是这样。 :)

如果使用宽度为4的空格缩进是所有文件中默认使用的缩放方式,请在用户偏好设置中设置这些设置,并记住它们可以被项目覆盖设置和语法特定的设置:

// The number of spaces a tab is considered equal to 
"tab_size": 4, 

// Set to true to insert spaces when tab is pressed 
"translate_tabs_to_spaces": true, 
// The number of spaces a tab is considered equal to 
"tab_size": 4, 

// Set to true to insert spaces when tab is pressed 
"translate_tabs_to_spaces": true,