我尝试了一些解决方案,没有完美的。有一个可行的解决方案:[已解决] ST3:“tab_completion”:false 不起作用,但现在我想提供我的(受此链接 ↑ 启发,感谢@OdatNurd)。
1.首选项->键绑定
2. 在左侧窗口搜索'"keys": ["tab"]',然后你会得到一组结果。对我来说是这样的:
{ "keys": ["tab"], "command": "auto_complete", "args": {"mini": true, "default": "\t"},
"context":
[
{ "key": "auto_complete_visible", "operand": false },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "setting.tab_completion", "operator": "equal", "operand": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": ".*\\w", "match_all": true },
]
},
{ "keys": ["tab"], "command": "expand_snippet", "context":
[{ "key": "has_snippet" }, ]
},
{ "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": "move", "args": {"by": "lines", "forward": true}, "context":
[
{ "key": "overlay_has_focus", "operator": "equal", "operand": true }
]
},
{ "keys": ["tab"], "command": "next_field", "context":
[{ "key": "has_next_field", "operator": "equal", "operand": true }]
},
{ "keys": ["tab"], "command": "commit_completion", "context":
[{ "key": "auto_complete_visible" }]
},
(我不想暗示它应该是什么样子,因为不同的 sublime 版本会有不同的设置。)
3. 将它们全部复制到右侧窗口中。
4. 删除(或只是注释掉)窗口右侧的“auto_complete”块和“commit_completion”块,不要更改任何其他内容。现在,我的用户键绑定是这样的:
// Disable all autocompletion and tab completion. This overrides the default
// binding for this key.
{ "keys": ["tab"], "command": "insert", "args": {"characters": "\t"} },
// { "keys": ["tab"], "command": "auto_complete", "args": {"mini": true, "default": "\t"},
// "context":
// [
// { "key": "auto_complete_visible", "operand": false },
// { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
// { "key": "setting.tab_completion", "operator": "equal", "operand": true },
// { "key": "preceding_text", "operator": "regex_match", "operand": ".*\\w", "match_all": true },
// ]
// },
{ "keys": ["tab"], "command": "expand_snippet", "context":
[{ "key": "has_snippet" }, ]
},
{ "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": "move", "args": {"by": "lines", "forward": true}, "context":
[
{ "key": "overlay_has_focus", "operator": "equal", "operand": true }
]
},
{ "keys": ["tab"], "command": "next_field", "context":
[{ "key": "has_next_field", "operator": "equal", "operand": true }]
},
// { "keys": ["tab"], "command": "commit_completion", "context":
// [{ "key": "auto_complete_visible" }]
// },
- 好好享受 。此解决方案不会破坏片段索引,您可以使用
enter
.