2013-02-19 31 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