厌倦了自动补全HTML标签?
很可能你就是因为这个问题而来到这里。 在SublimeText中,如果您在“label”或“form”等单词后按Tab键,它会认为您要插入一个tag并自动完成。实际上,如果您处于类似HTML的上下文中,您几乎无法在这样的单词后插入制表符。
我刚刚找到了禁用此功能的方法。因为tab_completion:false并不能解决这个问题。打开资源文件、编辑Python脚本或者尝试网上能够找到的其他任何方法都没用——直到你意识到整个问题在于Tab键的功能被硬编码了;所以只需要打开你的键绑定,在默认设置中的左边查找以下神奇序列:
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},
"context":
[
{ "key": "setting.tab_completion", "operator": "equal", "operand": true },
{ "key": "preceding_text", "operator": "not_regex_match", "operand": ".*\\b[0-9]+$", "match_all": true },
]
},
{ "keys": ["tab"], "command": "replace_completion_with_next_completion", "context":
[
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
]
},
{ "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": ["tab"], "command": "indent", "context":
[
{ "key": "text", "operator": "regex_contains", "operand": "\n" }
]
},
{ "keys": ["tab"], "command": "next_field", "context":
[
{ "key": "has_next_field", "operator": "equal", "operand": true }
]
},
{ "keys": ["tab"], "command": "commit_completion", "context":
[
{ "key": "auto_complete_visible" },
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
现在你只需要把这个复制到右边 (keymap - user) ,然后删除顶部的两个声明。那些说“insert_best_completion”的声明。这样,你的 Tab 键仍然可以像往常一样完成所有技巧,缩进/取消缩进等操作,
除了那个让你疯狂已久的自动完成功能。
哦,不客气。
不,真的,我很乐意帮忙。
无法形容我现在有多么宽慰。