2013-03-18 61 views
1

簡單的問題,我剛剛開始在Windows上使用Sublime Text 2進行編碼,並且我想改變一些小東西,比如當我正在編寫if語句(如if(i> 0))時,鍵入「0」,我的光標介於「0」和「)」之間,所以如果我按回車鍵,我希望它跳到「)」後面。我習慣了日食,所以我想知道如何讓設置模仿日食。我試過編輯設置文本文件,但找不到我在找什麼。使用Sublime Text進行編碼2

回答

5

嘗試增加(通過Preferences -> Key Bindings - User訪問)以下到您的用戶鍵綁定

{ "keys": ["enter"], "command": "move", "args": {"by": "characters", "forward": true}, 
    "context": [ 
    { "key": "selection_empty", "operator": "equal", "operand": true }, 
    { "key": "preceding_text", "operator": "not_regex_match", "operand": "[[:space:]]*", "match_all": true }, 
    { "key": "following_text", "operator": "regex_contains", "operand": "^[\\)]", "match_all": true }, 
    { "key": "auto_complete_visible", "operator": "equal", "operand": false } 
]} 

編輯:更新的正則表達式只匹配括號。

+0

不幸的是,那並沒有工作 – abaratham 2013-03-18 02:00:37

+0

實際上,我只是一個白癡,它工作完美,非常感謝 – abaratham 2013-03-18 02:04:41

+0

@abaratham沒問題,我很困惑,因爲我做了一個快速測試,它似乎工作。但是,我使用類似的東西,但使用tab作爲鍵綁定,但對於返回,您可能想要從正則表達式中刪除'\\} \\'''和'\「'',所以它只能用於括號編輯答案以反映變化。 – skuroda 2013-03-18 02:07:19