【发布时间】:2022-09-22 22:59:35
【问题描述】:
我在 keybindings.json 中做了一些更改:
{
\"key\": \"cmd+enter\",
\"command\": \"editor.action.insertLine\", // this doesn\'t work, command not found
\"when\": \"editorTextFocus\"
},
{
\"key\": \"enter\",
\"command\": \"editor.action.insertLineAfter\", // to insert line below, this works correctly
\"when\": \"editorTextFocus\"
}
我的想法是防止出现以下情况:
print(\"sentence~\") # here I am pushing \"Enter\" while cursor is in ~ place
print(\"sentence
\")
现在,在更改之后,虽然光标在 \") 之前,但它在按下 \"Enter\" 后会跳到新行,这与预期的一样(90% 的使用率)。
我现在的问题是,之前的命令(在按下 \"Enter\" 之后)不再存在。 所以我不能将中间的行减半(使用量的 10%),然后在光标后的前一行的其余部分转到新行。
我正在寻找一个可以固定到“Cmd + Enter”的命令。我想也许只是“editor.action.insertLine”,但它是不正确的。
谢谢您的帮助, 乳酪