sublime 3标签和空格不匹配

时间:2016-11-12 19:39:19

标签: sublimetext3 sublimetext sublime-text-plugin

我已经浏览了3次网络,但仍无法解决。

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

我将首选项设置更改为标签大小为4,特定语法设置,一切,但仍然是同样的问题。

任何想法?

1 个答案:

答案 0 :(得分:2)

点击状态栏上的缩进信息,即Tab Size: numSpaces: num,并显示上下文菜单。< / p>

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,
相关问题