Vscode: Default keybindings that conflict with default Ubuntu OS keybindings

Created on 23 Nov 2015  路  18Comments  路  Source: microsoft/vscode

_Related https://github.com/Microsoft/vscode/issues/51_

The following default keybindings conflict with default Ubuntu OS keybindings.

Move app to different workspace:

{ "key": "ctrl+shift+alt+down",   "command": "editor.action.copyLinesDownAction",
                                     "when": "editorTextFocus" },
{ "key": "ctrl+shift+alt+up",     "command": "editor.action.copyLinesUpAction",
                                     "when": "editorTextFocus" },
{ "key": "ctrl+shift+alt+left",   "command": "workbench.action.focusLeftEditor" },
{ "key": "ctrl+shift+alt+right",  "command": "workbench.action.focusRightEditor" },

Maximize/unmaximize(?):

{ "key": "ctrl+meta+up",          "command": "editor.action.insertCursorAbove",
                                     "when": "editorTextFocus" },
{ "key": "ctrl+meta+down",        "command": "editor.action.insertCursorBelow",
                                     "when": "editorTextFocus" },
*as-designed linux

Most helpful comment

As we now have very many users on Linux (not only on Unity), I don't plan to make any changes to the default keybindings, as changes to the defaults will break the flow of folks not using Ubuntu + Unity.

I am sorry if this causes any grief, but it is very simple to customize keybindings. Furthermore, it is very simple to create an extension which customizes default keybindings. Such an extension could be published to the marketplace and called "Ubuntu Unity optimized keymap" etc.

All 18 comments

@Tyriar Again, would love your input to find better out of the box defaults

@Tyriar I think the changes for #51 also address this issue. Is that fair?

@alexandrudima did #51 change focus*Editor and copyLines*Action?

@Tyriar Sorry about that, it was getting late yesterday :smile: You're right, those ones I didn't touch

Coming from ST3 I use ctrl-shift-d a lot to duplicate a line. I realise this conflicts with workbench.view.debug but thought I'd share here anyway.

What about Ctrl+D to duplicate line?
This is used in both notepad++ and geany editors:
https://wiki.geany.org/howtos/sorted_keyboard_shortcuts
http://docs.notepad-plus-plus.org/index.php/Keyboard_And_Mouse_Shortcuts

{ "key": "ctrl+d",   "command": "editor.action.copyLinesDownAction",
                                     "when": "editorTextFocus" },

Ctrl-d is currently used for multiple cursor selection, I also use this all the time so I'd vote for that to stay as it is!

Yeah ctrl+d is quite a well known keybinding so that definitely isn't going to change.

I want to migrate to _vscode_ but, like every body else on Ubuntu, really need to duplicate lines.
Any news about this?

What you recommend?:

  • change default Ubuntu keybindings? Here is how to on AskUbuntu. (I haven't tested yet. I don't want to tweak my OS coz of editor)
  • or change default keybindings of _vscode_? Is here any conflict free recommended key combination? Have any of you investigate it?

For now I create my custom keybindings of _vscode_.
To Ctrl+Shift+Alt+Up I added meta (In my case _meta_ is win key Windows Key I don't understand it because it should be _super_ not _meta_).
So I use
Windows Key+Ctrl+Shift+Alt+Up
or
Windows Key+Ctrl+Shift+Alt+Down
and vscode is duplicating lines now. What a surprice it works.

For newbies (like my self) go to File > Preferences > Keyboard Shortcuts and edit keybindings.json.

// Place your key bindings in this file to overwrite the defaults
[
{ "key": "meta+ctrl+shift+alt+down",   "command": "editor.action.copyLinesDownAction",
                                     "when": "editorTextFocus && !editorReadonly" },
{ "key": "meta+ctrl+shift+alt+up",     "command": "editor.action.copyLinesUpAction",
                                     "when": "editorTextFocus && !editorReadonly" }
]

@mattez Just customize vscode's keybindings -- File > Preferences > Keyboard Shortcuts.

[{ "key": "ctrl+shift+d", "command":"editor.action.copyLinesDownAction", "when": "editorTextFocus && !editorReadonly" }]

@alexandrudima Thank you. I'm so impatient. I edited my previous comment, before I read yours. Now a little ashamed.
It is a pity that the Ctrl+Shift+D is now used to Show Debug _workbench.view.debug_. It may not suit to all to change this.

But I agree I'm newbie who don't use Debug yet. And also I don"t need two duplication actions (up & down) I need only one _duplicate_.

Hi guys, I can help with this issue if there's a final decision on it. Recently migrated to vscode and ran into this problem today

I would be hesitant to do anything here as it could break people. However, if there are keybindings that differ on Windows and Linux but they're broken on Linux maybe we could look into this.

Also this issue applies specifically to Unity on Ubuntu which is now deprecated. I haven't checked what windows management keybindings Ubuntu Gnome ships out of the box but we should target them as the primary example on Linux going forward.

Why is it not by default set to Ctrl+D and Ctrl+Shift+D for copy line up and down respectively?? Most editors have them on those bindings.

@cpxPratik since the initial version ctrl/cmd+d has been assigned to the "Add selection to next find match" command. I wasn't around to explain that decision but it's a very popular keybinding at this point so I doubt we would ever change the default.

I think it's from Sublime Text; I remember using the same shortcut for that as well.

@Tyriar I customized key-binding for copy line down with Ctrl+D and it works for both uses, i.e. "Add selection to next find match" too.

As we now have very many users on Linux (not only on Unity), I don't plan to make any changes to the default keybindings, as changes to the defaults will break the flow of folks not using Ubuntu + Unity.

I am sorry if this causes any grief, but it is very simple to customize keybindings. Furthermore, it is very simple to create an extension which customizes default keybindings. Such an extension could be published to the marketplace and called "Ubuntu Unity optimized keymap" etc.

Was this page helpful?
0 / 5 - 0 ratings