每当我在sublime中输入'
时,它会添加终止引用'
并将光标放在中间,如下所示:'|'
"
同样适用于"|"
。
这对我来说是不受欢迎的行为,我发现将其关闭的唯一方法是设置:
"auto_indent": false,
然而,这使得编写缩进代码变得很麻烦。
有没有让Sublime没有完成字符串文字并保留auto_indent
?
我在Windows上的Sublime 3 Build 3114和Linux上的Sublime 3 Build 3083上进行了测试。
答案 0 :(得分:2)
如您在默认键绑定中的定义中所示,设置的名称应为auto_match_enabled
:
// Auto-pair quotes
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\""}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\"a-zA-Z0-9_]$", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true }
]
},