Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Keybinding Overloading #39888

Open
brandondrew opened this issue Dec 7, 2017 · 7 comments
Open

Feature Request: Keybinding Overloading #39888

brandondrew opened this issue Dec 7, 2017 · 7 comments
Labels
feature-request Request for new features or functionality keybindings VS Code keybinding issues
Milestone

Comments

@brandondrew
Copy link

I'm not asking for the ability to run multiple commands in sequence, as mentioned in

or as addressed with the macros extension

I'd like to be able to assign a given keybinding to multiple different commands separately, and if multiple commands are applicable in the current context when the keystroke is used, present the user with a menu of the options, rather than considering it a conflict, where only one can "win".

There are many significant benefits to this:

  • You don't have to worry about keybindings from your multiple extensions conflicting with each other.
  • All extension authors can add the keybinding they think makes the most sense, instead of telling you to manually add it in your own personal keybindings.json.
  • You don't have to worry about your personal keybindings clobbering a default keybinding (this sort of conflict does not appear when you use "Show Conflicts"—at least it did not in my tests).
  • You will never accidentally use the wrong command because of a conflict in which you expected another command to be triggered by your keybinding.
  • You can purposefully add multiple related commands to the same keybinding, so that you have fewer bindings to memorize. For example,
    • you could assign all of your Git-related commands to G, or, for more focused groupings,
    • you could assign all variations of Git commands related to adding files to A, and those related to commiting to C, and so forth.
  • You can experiment with changed keybindings without having to change the whole world in order to accommodate the change you think you might prefer.

Since there may be people who have grown accustomed to existing conflicts in their keybindings (and accustomed to the current winner) it would make sense for this behavior to have a setting to turn it on or off, so that they are not presented with a menu containing what used to be considered "conflicts" but under the new behavior are simply alternate options assigned to the same keystroke.

@vscodebot vscodebot bot added the keybindings VS Code keybinding issues label Dec 7, 2017
@brandondrew
Copy link
Author

I've just discovered that VS Code apparently lacks a Key Resolver, which makes this suggestion even more valuable than I realized when I posted this. (But even with a key resolver, this would be very valuable, for the reasons given above.)

@brandondrew
Copy link
Author

I also encountered a conflict that resulted from the "one binding wins" approach, which caused me much initial confusion.

While editing a markdown file, I tried navigating one tab to the left, but nothing happened. After testing the usual suspects—frozen OS, keyboard disconnected, accidentally activated MouseKeys—I had to test whether VS Code supported that nearly universal keystroke.

Of course it does, but it turns out some Markdown-related extension clobbered it, so that [ was instead bound to changing the heading level of the current line. Since it had no heading level there was no change visible, hence the appearance that the keystroke had done nothing.

Eliminating this sort of confusion would be just one of the many benefits of replacing a one-binding-wins approach with a menu-of-bound-commands approach.

@alexdima alexdima added the feature-request Request for new features or functionality label Dec 13, 2017
@alexdima alexdima removed their assignment Dec 13, 2017
@alexdima alexdima added this to the Backlog milestone Dec 13, 2017
@Qussayyon
Copy link

It should be number 1 implemented feature.

@brandondrew
Copy link
Author

@alexandrudima any chance of this being pulled out of the backlog?

@FredHappyface
Copy link

This is certainly something I would like to see implemented as it causes an extension that I built to break the functionality of another

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality keybindings VS Code keybinding issues
Projects
None yet
Development

No branches or pull requests

5 participants
@brandondrew @alexdima @Qussayyon @FredHappyface and others