如何在sublime 3中设置括号的返回空间?

sta*_*lei 6 sublimetext sublimetext3

当我action()在括号之间输入并点击返回时,我得到这个:

action (
    )
Run Code Online (Sandbox Code Playgroud)

而不是这个:

action (
)
Run Code Online (Sandbox Code Playgroud)

我该如何改变?

我现在在我的键绑定中有这个,但它只适用于非js文件 -

[
    { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
        [
            { "key": "setting.auto_indent", "operator": "equal", "operand": true },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "preceding_text", "operator": "regex_contains", "operand": "\\($", "match_all": true },
            { "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
        ]
    },
    { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
        [
            { "key": "setting.auto_indent", "operator": "equal", "operand": true },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "preceding_text", "operator": "regex_contains", "operand": "\\[$", "match_all": true },
            { "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
        ]
    },
    { "keys": ["super+shift+\\"], "command": "reveal_in_side_bar"},
    {"keys": ["tab"], "command": "expand_abbreviation_by_tab", "context":
      [
        { "operand": "source.js", "operator": "equal", "match_all": true, "key": "selector" },
        { "match_all": true, "key": "selection_empty" },
        { "operator": "equal", "operand": false, "match_all": true, "key": "has_next_field" },
        { "operand": false, "operator": "equal", "match_all": true, "key": "auto_complete_visible" },
        { "match_all": true, "key": "is_abbreviation" }
      ]
    },
]
Run Code Online (Sandbox Code Playgroud)

sv_*_*an5 4

如果没有任何效果,那么您可以在 sublime 中为自己编写一个片段,如下所示(菜单栏 -> 工具 -> 开发人员 -> 新片段),然后输入以下代码并保存。

<snippet>
    <content><![CDATA[
action(${1:}
)
]]></content>
    <tabTrigger>act</tabTrigger>
    <!-- <scope>source.JavaScript</scope> -->
</snippet>
Run Code Online (Sandbox Code Playgroud)

这是一种临时解决方案,而不是最好的解决方案。但暂时还可以。