sublime换行无法自动缩进

 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" },

 

 

posted @ 2018-08-17 13:04  格鲁特baby  阅读(127)  评论(0编辑  收藏  举报