Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move Cursor Up or Down Multiple Lines at once in VS Code

Note: I have searched in Google and other SO posts, but none of them have helped me.

I know that we can move up or down with Alt+Arrow. Is there a way to move, let's say 25 lines up, at once? I don't want to press Alt+ 25 times.

Is there a plugin or a built-in feature to do this?

The reason I'm asking is that it's easier to move multiple lines at once due to the relative line numbers feature in VS Code.

I don't want to specify each number in keybindings.json (As seen here).

like image 546
Sid110307 Avatar asked Dec 06 '25 05:12

Sid110307


1 Answers

To make it easier to navigate the cursor in blocks of lines you could set a keybinding to jump 10 lines up or down at once (in your 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"
}

As noted in the comments, this comes from https://stackoverflow.com/a/48568520/836330 so upvote that.

like image 182
Mark Avatar answered Dec 08 '25 20:12

Mark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!