VSCode column selection with keyboard

By default, this is Ctrl + Shift + Alt + Arrow.

If you would like to rebind it to align with Visual Studio, put this in your keybindings.json:

{
    "key": "shift+alt+down",
    "command": "cursorColumnSelectDown",
    "when": "editorTextFocus"
},
{
    "key": "shift+alt+left",
    "command": "cursorColumnSelectLeft",
    "when": "editorTextFocus"
},
{
    "key": "shift+alt+pagedown",
    "command": "cursorColumnSelectPageDown",
    "when": "editorTextFocus"
},
{
    "key": "shift+alt+pageup",
    "command": "cursorColumnSelectPageUp",
    "when": "editorTextFocus"
},
{
    "key": "shift+alt+right",
    "command": "cursorColumnSelectRight",
    "when": "editorTextFocus"
},
{
    "key": "shift+alt+up",
    "command": "cursorColumnSelectUp",
    "when": "editorTextFocus"
}

This will conflict with the default functions of that duplicating a line or growing/shrinking with smart select, so you can add this to swap those to require Control:

,
{
    "key": "ctrl+shift+alt+down",
    "command": "editor.action.copyLinesDownAction",
    "when": "editorTextFocus && !editorReadonly"
},
{
    "key": "ctrl+shift+alt+up",
    "command": "editor.action.copyLinesUpAction",
    "when": "editorTextFocus && !editorReadonly"
},
{
    "key": "ctrl+shift+alt+right",
    "command": "editor.action.smartSelect.grow",
    "when": "editorTextFocus"
},
{
    "key": "ctrl+shift+alt+left",
    "command": "editor.action.smartSelect.shrink",
    "when": "editorTextFocus"
}

Leave a Comment