【问题标题】:Is there a VS Code shortcut to move/select up/down to the next empty line?是否有 VS Code 快捷方式可以向上/向下移动/选择到下一个空行?
【发布时间】:2017-08-21 00:54:43
【问题描述】:

我刚刚从 Sublime 过渡到 VS Code,我很喜欢它。想知道是否有等效的组合,或设置它们的方法,用于跳转/选择行块,向下/向上到下一个空白行。这就是我在 ST3 中的样子:

{"keys": ["ctrl+shift+["], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": false, "extend": true}},
{"keys": ["ctrl+shift+]"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true, "extend": true}},
{"keys": ["ctrl+{"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": false, "extend": true}},
{"keys": ["ctrl+}"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true, "extend": true}},

【问题讨论】:

    标签: visual-studio-code vscode-settings


    【解决方案1】:

    The following plugin meets your requirments I believe

    引自插件描述

    通过在代码“段落”上跳转到最近的空行,在文本编辑器中移动,可选择沿途选择文本。

    提供了以下命令和相应的默认键绑定:

    block-travel.jumpUp: alt+up
    block-travel.selectUp: alt+shift+up
    block-travel.jumpDown: alt+down
    block-travel.selectDown: alt+shift+down
    

    【讨论】:

    • 请不要只发布一些工具或库作为答案。至少在答案本身中展示how it solves the problem
    • 这是您发布的第二个推荐此插件的答案。 您必须披露您的从属关系,如果有的话!另外,请不要只发布工具作为上述的答案。添加更多上下文。如果链接页面发生变化怎么办?
    • 我没有隶属关系,这样解释更好吗?
    【解决方案2】:

    这是 Insiders' Build for v1.54,没有扩展。 prevBlankLinenextBlankLine to 值已添加到 cursorMove 命令。见https://github.com/microsoft/vscode/pull/115578

    {
        "key": "ctrl+shift+[",    // whatever keybinding you want
        "command": "cursorMove",
        "args": {
            "to": "prevBlankLine",
            "select": true
        },
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+]",
        "command": "cursorMove",
        "args": {
            "to": "nextBlankLine",
            "select": true
        },
        "when": "editorTextFocus"
    },
    

    【讨论】:

      猜你喜欢
      • 2012-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-09
      • 1970-01-01
      • 2016-01-17
      • 1970-01-01
      • 2017-09-25
      相关资源
      最近更新 更多