2013-02-19 34 views
0

双引号的自动配对是一个非常奇怪的问题that I thought I'd solved但仍然存在。问题在于,对于扩展名为.php,.html的文件,自动配对双引号的默认字体样式无法解析。为了向您展示我的意思,请注意左侧的<div>中双引号的字体样式。而对于.js和.css文件,双引号自动配对具有正确的字体样式,如右侧的<div>所示。Sublime Text 2双引号字体样式取决于文件扩展名吗?

这必须是一个设置的地方,但我不知道Sublime Text2(Mac OSX)如此好。思考?

enter image description here

+1

也许还有另一个插件,转移Shift的键盘映射?您是否尝试过查看所有非默认包的键盘映射? – JamieJag 2013-02-21 10:00:23

+0

@JamieJag谢谢,你能告诉我该怎么做吗?我是一个崇高的新手 – 2013-02-21 11:56:30

+1

这是一个单调乏味的过程 - 转到Preferences-> Browse Packages,在列出的每个文件夹中,您可以识别为您安装的软件包,请查看'Default(OSX).sublime-keymap 'shift +'或shift +' – JamieJag 2013-02-22 13:08:47

回答

0

有了巨大的帮助从@JamieJag我已经分离出的问题。按住Shift +”正在产生什么崇高称之为‘印刷’引号,而不是双引号这是可分析作为PHP的一部分或HTML代码。

要解决这个问题,我在SublimeText2首选项 - >键绑定注释掉一切 - > 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 } 
    ] 
} 

]*/ 
+1

似乎您需要做的就是在设置中将“auto_match_enabled”设置关闭为“false”,因为所有这些键映射似乎只有在设置为真正 – JamieJag 2013-02-23 23:05:18