Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there a way to jump multiple lines while i'm in selection mode in VSCode?

I want to jump x lines vertically when im in selection/highlight mode in VSCode.

That’s what i tried so far:

keybindings.json:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

 {
        "key": "cmd+[Backquote]",
        "command": "runCommands",
        "args": {
            "commands": [
                {
                    "command": "cursorMove",
                    "args": {
                        "to": "up",
                        "by": "line",
                        "value": 10
                    }
                }
            ]
        },
        "when": "editorHasSelection"
    }

It works fine without selection:

    {
        "key": "cmd+[Backquote]",
        "command": "cursorMove",
        "args": {
            "to": "up",
            "by": "line",
            "value": 10
        },
        "when": "editorTextFocus"
    },

>Solution :

Not exactly what you’re asking for, but it sounds to me kind of like you want the anchor selection commands. Before using your jump command, just set a selection anchor, and then once you’ve jumped to where you want the selection to end, use the command to select from the anchor to your cursor. Then you don’t even need to when-clause for selection context. You can just use a regular cursor-move keybinding for the jumping bit.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading