In VSCode, when I try to use the shortcut to copy a line, Ubuntu is triggering a shortcut to move to a different workspace?

Viewed 273

When I'm working in Visual Studio Code and I attempt to use the shortcut to Copy Line Down (Alt + Shift + Ctrl + Down Arrow) it seems like Ubuntu is taking over and triggering a shortcut to switch to a different workspace.

I've checked my keyboard shortcuts for Ubuntu and it seems like the only shortcuts that would doing that are mapped to Shift + Super + PageDown. I don't see anything in the keyboard shortcuts that is mapped to the same shortcut (Alt + Shift + Ctrl + Down Arrow). Am I missing something here? Any suggestions on how to rectify this?

3 Answers

If you want to copy a whole line you can use Ctrl + C without highlight anything (just stay in the line). If you want to move a line you can use Alt + ↑ to move the line up and Alt + ↓ move the line down.

New Ubuntu user. Spent few hours sweating on this. Seems Ubuntu is blocking ALT key press as it is reserved for OS purposes (disturbing development?!).

Best new shortcut I could come up with that does not interfere with other major VSCode functionality corresponding to Copy Line Up/Down commands are below. From keybindings.json

{
    "key": "ctrl+shift+.",
    "command": "editor.action.copyLinesDownAction",
    "when": "editorTextFocus && !editorReadonly"
},
{
    "key": "ctrl+shift+,",
    "command": "-editor.action.copyLinesUpAction",
    "when": "editorTextFocus && !editorReadonly"
},

To copy a line up or down in VS code;

alt + shift + UP (or DOWN key).

Here are some more shortcuts which may help you in other conditions;

Alt + up or down (moves the whole line up or down.)
ctrl + right or left key (jumps from word to word towards right or left.)
ctrl + shift + right or left key(jumps from word to word and also selects in the same direction.)
Related