在 VS Code 中一次向上或向下移动多行光标

Coo*_*SRS 15 line-numbers visual-studio-code

\n

注意:我在 Google 和其他 SO 帖子中进行了搜索,但没有一个对我有帮助。

\n
\n

我知道我们可以用Alt+向上或向下移动Arrow。有没有办法同时移动 25 条线?我不想按Alt+ \xe2\x86\x9125 次。

\n

是否有插件或内置功能可以执行此操作?

\n

我问的原因是,由于 VS Code 中的相对行号功能,一次移动多行更容易。

\n

我不想指定keybindings.json(如此所示)中的每个数字。

\n

Mar*_*ark 20

为了更容易地在行块中导航光标,您可以设置一个键绑定来一次向上或向下跳转 10 行(在 keybindings.json 中):

{
    "key": "ctrl+up",         // whatever keybinding you want
    "command": "cursorMove",
    "args": {
        "to": "up",
        "by": "line",
        "value": 10         // change this if you want
    },
    "when": "editorTextFocus"
},
{
    "key": "ctrl+down",        // whatever keybinding you want
    "command": "cursorMove",
    "args": {
        "to": "down",
        "by": "line",
        "value": 10         // change
    },
    "when": "editorTextFocus"
}
Run Code Online (Sandbox Code Playgroud)

正如评论中所指出的,这来自/sf/answers/3399796431/所以赞成。