当我输入 action()
并在括号之间点击返回,我得到这个:
action (
)
而不是这个:
action (
)
我该如何改变?
我现在在我的键绑定(bind)中有这个,但它只适用于非 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" }
]
},
]
最佳答案
如果没有任何效果,那么您可以像这样在 sublime 中为自己编写一个片段(菜单栏 -> 工具 -> 开发人员 -> 新片段),然后输入以下代码并保存。
<snippet>
<content><![CDATA[
action(${1:}
)
]]></content>
<tabTrigger>act</tabTrigger>
<!-- <scope>source.JavaScript</scope> -->
</snippet>
这是一个临时解决方案,不是最好的。但暂时它可以工作。
关于sublimetext3 - 在 sublime 3 中如何在括号上设置返回空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43486799/