在Sublime中,我可以轻松设置一个更复杂的热键,让我按Enter键退出引号和括号.它在下面:
// Move out of single and double quotes with `Enter`
{
"keys": ["enter"],
"command": "move",
"args": {"by": "characters", "forward": true},
"context": [
{ "key": "following_text", "operator": "regex_match", "operand": "(?:\"|').*", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "(?:\"|')", "match_all": true }
]
},
Run Code Online (Sandbox Code Playgroud)
在VS Code中,有没有办法实现这个目标?这keybindings.json会移动光标,但是当我不想要时它也是活动的.谢谢.
{ "key": "enter", "command": "cursorRight",
"when": "editorTextFocus" }
Run Code Online (Sandbox Code Playgroud)