自动双引号配对是一个非常奇怪的问题,that I thought I'd solved,但仍然存在。问题是,对于扩展名为.php、.html的文件,自动成对双引号的默认字体样式是不可解析的。为了向您展示我的意思,请注意左侧<div>中双引号的字体样式。而对于.js和.css文件,双引号自动配对具有正确的字体样式,如right>上的<div>中所示。
这肯定是在某个地方设置的,但我不太了解Sublime Text2 (Mac )。有什么想法?

发布于 2013-02-23 04:02:28
在@JamieJag的巨大帮助下,我已经隔离了这个问题。PHP“产生了Sublime所说的"typographical"引号,而不是双引号,双引号是Shift+或HTML代码的一部分。
为了解决这个问题,我注释掉了SublimeText2 preferences->key bindings->user中的所有内容。
我不清楚是这些JSON对象中的一个还是全部导致了问题行为(尽管我猜第一个JSON看起来像是攻击者),但是到目前为止,仅仅注释掉整个数组就解决了我的问题。
/*[
// Auto-pair typographical 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": "selector", "operator": "equal", "operand": "text", "match_all": true }
]
},
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "“${0:$SELECTION}”"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "text", "match_all": true }
]
},
{ "keys": ["\""], "command": "move", "args": {"by": "characters", "forward": true}, "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": "^\\”", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "text", "match_all": true }
]
},
// Smart quotes before & after word
{ "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": "^\\S", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "text", "match_all": true }
]
},
{ "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": "preceding_text", "operator": "regex_contains", "operand": "^\\S", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "text", "match_all": true }
]
}
]*/https://stackoverflow.com/questions/14960270
复制相似问题