如何防止Sublime Text 3跳过括号?

时间:2016-09-20 13:25:30

标签: sublimetext3 sublimetext text-editor

我在Ubuntu 16.04上使用Sublime Text 3 Build 3114和这个ST3"功能"让我发狂。

如何防止Sublime Text 3跳过结束括号。您可以在下面看到GIF中的行为。在那个gif我只按下关闭paren )。正如你所看到的那样,前两个parens没有注册,因为它们已经存在,ST只是跳过现有的pare,只在光标后没有关闭paren时才绘制paren。

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

enter image description here

1 个答案:

答案 0 :(得分:3)

一种可能性是在您的用户首选项中设置"auto_match_enabled": false。这将确保始终插入括号。 但是,它确实意味着在键入(时,它永远不会自动插入结束括号。

如果您不想丢失此自动配对功能,可以在用户keybindings文件中插入以下内容:

{ "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 }
    ]
},

将覆盖在括号上移动的默认键绑定。

相关问题