<div>
This line needs to be indented and closing div tag should be in a new line</div>
<div>
This result is what I want
</div>
在 Sublime Text 2 中,通过按 ctrl+shift+W 并按“enter”创建标签后,我希望结果如上所示。我必须安装插件还是我缺少某些东西?
最佳答案
认为您正在尝试执行与此问题相同的操作 - Auto-indent new line when hitting enter to expand one-line tag in HTML .
以下是我的回答。
尝试在您的用户键绑定(bind)中添加以下内容。
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
{ "key": "selector", "operator": "equal", "operand": "meta.scope.between-tag-pair", "match_all": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }
]
}
关于html - Sublime Text 2 换行缩进,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15755737/