user956609
user956609

Reputation: 1311

Select whole line but cursor in the left in Visual Studio Code?

In visual studio code there is expandLineSelection command in keyboard shortcuts to select a whole line, and after trigger this, the cursor is in the next line,

enter image description here

Is there any way to select the whole line but the cursor is at the left most of the line?

Upvotes: 1

Views: 939

Answers (2)

Mark
Mark

Reputation: 182621

Go to beginning of next line (Home) and hit

  1. Shift+Left (select the preceding newline)
  2. Shift+Home (select to the beginning)

If you really want it in one command, use the multi-command extension.

Upvotes: 0

rioV8
rioV8

Reputation: 28793

You can use extensions multi-command and Select By

Define a keybinding:

{
    "key": "alt+k",  // or any other combo
    "command": "extension.multiCommand.execute",
    "args": { 
        "sequence": [
            "expandLineSelection",
            "selectby.swapActive"
        ]
    }
}

You can use the same keyboard shortcut as defined for expandLineSelection

Upvotes: 1

Related Questions