在 VSCode 中选择代码块/段落的开头或结尾的命令

问题描述

所以我在 GitHub 上找到了 this issue,它讨论了代码块/段落的光标导航。是否有相关功能可以同时选择从当前光标位置到下一个块的结尾或开头?

解决方法

可以通过将 "select": true, 添加到链接的 GitHub 问题中描述的键绑定中的 "args" 列表来完成选择。所以最终的结果看起来像这样(在键绑定中添加 shift 以将其与段落导航命令区分开来):

{
    "key": "ctrl+shift+down","command": "cursorMove","when": "editorTextFocus","args": {
        "to": "nextBlankLine","by": "wrappedLine","select": true,}
},{
    "key": "ctrl+shift+up","args": {
        "to": "prevBlankLine",}
}