2

Every time I type an opening html tag (like <div>) then press the Enter key, the cursor automatically inserts an indention on the next line. However I don't want it to be indented since I still have to write the closing tag (actually I press the enter twice and write the closing tag in the third line so I can have an empty line in between). Now I have to press the back button to align the cursor with the opening tag.

I am aware of Sublime Text 2's autocomplete like when you type '<' and Ctrl + Space, a list of available elements would appear. And when you select one item from the list, the editor would provide you of both the opening and the closing tag. However, I'm not used to that kind of typing.

So is there a way to turn off this annoying feature of Sublime Text 2

4

2 回答 2

3

auto_indent您可以通过设置来禁用自动缩进false

为了仅对 HTML 语法执行此操作,请转到Preferences/Settings – More/Syntax Specific – User并插入以下内容:

{
    "auto_indent": false
}

这将使光标在按回车后跳回到第 0 列。

要使其停留在开始标记的列,请重新启用auto_indent并调整Packages/HTML/Miscellaneous.tmPreferences. 如果您不喜欢正则表达式,请尝试完全摆脱此文件。

于 2013-09-12T16:16:01.410 回答
0

你也可以只输入结束</div>标签,sublime 文本会自动为你取消缩进。

于 2014-12-14T00:15:19.787 回答