2016-09-20 51 views
1

我在Ubuntu 16.04上使用Sublime Text 3 Build 3114,这个ST3“特性”令我发狂。如何防止Sublime Text 3跳过括号?

如何防止Sublime Text 3跳过结尾括号。您可以在下面看到GIF中的行为。在那个gif中,我只是按压关闭paren )。正如你可以看到前两个parens由于它们已经存在而未被注册,ST仅仅跳过现有的parens,并且在光标后没有关闭paren的时候只绘制paren。

是否有禁用此行为的设置?

enter image description here

+0

真的不清楚你在问什么 - 你想找到一个设置,防止你输入太多的左括号? – MattDMo

回答

1

一种可能性是设置在用户首选项"auto_match_enabled": false。这将确保总是插入一个括号。 但是,这确实意味着在输入(时,它永远不会自动插入右括号。

如果你不想失去这个自动配对功能,您可以将您的用户键绑定文件中的以下内容:

{ "keys": [")"], "command": "insert", "args": {"characters": ")"}, "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 } 
    ] 
}, 

这将覆盖移动在支架上的默认键绑定。