I have just started with VSCode on Ubuntu and was looking for the equivalent of cmd+shift+D
in Sublime on the Mac (duplicate selected text) . According to the docs I should use Ctrl+Shift+Alt+Down
or Ctrl+Shift+Alt+Up
but these keybindings are not working for me. When I look in File > Preferences > Keyboard Shortcuts
, I see the definitions, but when I try to use them, nothing happens.
Ubuntu uses those shortcuts for managing workspaces.
You can look for those keybindings in Settings -> Keyboard -> View and Customize Shortcuts
If there's nothing set to Ctrl+Shift+Alt+*
, you can check gsettings
The following command should find shortcuts bonded to combinations with Up
key:
gsettings list-recursively | grep Up
In my case there are those, which interfere with VS Code:
org.gnome.desktop.wm.keybindings move-to-workspace-up ['<Control><Shift><Alt>Up']
org.gnome.desktop.wm.keybindings switch-to-workspace-up ['<Control><Alt>Up']
The same goes with Down
key.
After all you can unset them by the following commands:
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-up "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-down "[]"
In case you would want to reset them back to defaults:
gsettings reset org.gnome.desktop.wm.keybindings switch-to-workspace-up
gsettings reset org.gnome.desktop.wm.keybindings switch-to-workspace-down
gsettings reset org.gnome.desktop.wm.keybindings move-to-workspace-up
gsettings reset org.gnome.desktop.wm.keybindings move-to-workspace-down
upon checking my default keybinding, i found that editor.action.insertCursorAbove and editor.action.insertCursorDown each has two keybindings ctrl+shift+up/down and alt+shift+up/down.
so i changed editor.action.copyLinesDownAction and editor.action.copyLinesUpAction to ctrl+shift+up and ctrl+shift+down respectively. because in my ubuntu system ctrl+shift+alt+up/down keys were toggling the workspace.
I was able to solve this by disabling all workspace shortcuts, which override ctrl+alt+left
etc:
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-up "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-down "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-left "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-right "[]"
Ctrl+Shirt+up and Ctrl+Shirt+down will work. Check your VS keyboard Shortcuts: Click settings icon>keyborad shortcuts enter image description here
© 2022 - 2025 — McMap. All rights reserved.
editor.action.insertLineBefore
. However, maybe the shortcuts are overwritten globally? What happens when you define custom shortcuts for the commands you are looking for? – Blowingkeybindings.json
and the shortcuts still don't work. Interestingly though, if I change the shortcut to Ctrl+Shift+Down, it does work! I wonder if Ubuntu is confused (as I probably would be) by so many keys being pressed at the same time :) – Pridgen