【问题标题】:Command to select to beginning or end of code block/paragraph in VSCode [duplicate]在VSCode中选择代码块/段落的开头或结尾的命令[重复]
【发布时间】:2021-09-17 09:50:22
【问题描述】:

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

【问题讨论】:

    标签: visual-studio-code navigation textselection


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2023-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-07
      • 2014-01-25
      • 1970-01-01
      • 2010-11-07
      • 1970-01-01
      相关资源
      最近更新 更多