Preferences->Key Bindings->user->编辑文档
输入
//解决换行无法自动缩进的问题
{ "keys": ["enter"], "command": "auto_indent_tag", "context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.tag.begin", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": ">$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^</", "match_all": true },
]
},
// Press the tab indent a sufficient distance
{ "keys": ["tab"], "command": "reindent", "context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
]
},
{ "keys": ["ctrl+alt+l"], "command": "reindent" },
{ "keys": ["f12"], "command": "open_in_browser" },

本文介绍如何在 Sublime Text 中配置自动缩进功能以解决 HTML 标签换行时的缩进问题,并设置 Tab 键以确保适当的缩进距离。此外还介绍了使用快捷键进行整段文本的重新缩进操作。

3244

被折叠的 条评论
为什么被折叠?



