【问题标题】:In Visual Studio Code, how does one clear multi-line cursors using a keyboard shortcut在 Visual Studio Code 中,如何使用键盘快捷键清除多行光标
【发布时间】:2018-03-07 08:49:15
【问题描述】:

在 Visual Studio 代码中,您可以使用键盘快捷键在当前行的上方和下方创建多个光标,从而允许在代码中的多个位置进行编辑。另见docs

但是,一旦您完成了多行编辑,如何使用键盘快捷键清除多个光标?

【问题讨论】:

  • Esc?........
  • @Alex 不。或者,当您将其绑定到 Intellisense 自动完成时,不。

标签: visual-studio-code multipleselection


【解决方案1】:

keybindings.json(代替 ctrl+; 你可以使用你的键绑定):

{
    "key": "ctrl+;",
    "command": "removeSecondaryCursors",
    "when": "editorHasMultipleSelections && editorTextFocus"
},
{
    "key": "escape",
    "command": "-removeSecondaryCursors",
    "when": "editorHasMultipleSelections && editorTextFocus"
}

【讨论】:

  • 我认为你有一个错字,在第二个块中,它应该是“removeSecondayrCursors”,而不是破折号。顺便说一句,它有效:D 谢谢!
  • 破折号代表removing keybinding
【解决方案2】:

如果我没记错的话,你问的是如何退出多行编辑模式?我相信你只需按 esc

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多