-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
enable keychords of 3 or more steps #6966
Comments
I'm writing an extension that provides an alternative to the ubiquitous use of emacs for a particular language. Some potential users are demanding that their crazy many-chorded keybindings be supported before moving to vscode... |
I can almost write an extension to provide this behavior... Say I want to map {"key": "ctrl+c ctrl+a", "command": "chords.c.a" },
{"key": "ctrl+b", "command": "some.command", "when": "chord.c.a"} Where command But I cannot think of a good way to exit the "chord.c.a" context when the next key is pressed. Something like Any suggestions? |
I very much like the Spacemacs.org model of things, and if multi key chords are supported, something similar can be achieved for VS code. |
I bet it is possible to implement this using just a plugin that defines modes. As long as you use the plugin to actually do the command as well a normal command can be run while also clearing the key chord modes used to implement the key chords |
Just as a datapoint, but I find that with the VSpaceCode extension I have found the Spacemacs chord emulation that I was looking for 🙂. While I still really believe that this should be addressed, the need has dramatically dropped for me as far as I'm concerned. If you really like Spacemacs chords, check out that extension! |
I too am using that extension and loving it. However this just makes a native implementation even more important to me, since it now showed me how good vscode can be with it. Further reasons for a native implementation are many edge cases, where the plugin collection from vspacecode is not able to be activated. Or being able to search for a command and seeing the shortcut (chord) in the "ctrl+shift+p" menu. So while it is indeed nice.. a native implementation would be nicer 😉 even for vspacecode I just wanted to comment that so the prior on this ticket does not drop even further 😄 |
I am not seeing it on the description page, does vspacecode support mapping arbitrary length key chords? |
@truesilver92 you can map arbitrary key chord lengths by creating multiple menus. VSpaceCode's functionality for chords is actually implemented by the vscode-which-key extension (it's installed along with VSpaceCode; VSpaceCode is just a "default keychord map", if you will). One limitation you should likely be away of is that I don't believe you can make multiple keychords that include modifiers, so something like I still think that having 3+ chords available to folks who don't want to install that extension is very handy, and should still be implemented for sure! Limiting chords to 2 always felt.... arbitrary 🙂 |
I'm also interested in this, I think it would be a great addition. What's the requirement for getting this approved/ voted, etc? |
This would need to check if the keyboard has n-key-rollover or limit at 6 keys right? |
It shouldn't need that. It is called a "chord" but it is not intended for multiple segments to be pressed at the same time; at most all the modifiers and a single character. |
+1 This is the only thing I need to be able to port my Vim keymaps to vscode. |
The basic ChordKeybinding class has an Array of SimpleKeybinding's, theres other bits of code though that do not support this though such as :- Keybindings seem to be represented as numbers in places that should hopefully be able to be replace by number Arrays Then there is the keybinding parser :- And UI stuff :- Not sure if this is complete yet probably not, but it looks scalable and doable. |
Okay I see why this has not been done now, its quite complex ! I am going to attempt it over the next week. |
Also interested. Please ask if you need help @AaronNGray |
@amirdib Sorry I printed out the relevant code it’s several pages that would probably need totally reworking then got distracted by other tasks. I will look the printouts out again and have a fresh look at them. |
I did make a plugin that enables you to have your own modes, at https://github.com/wmstack/contextually, though I still feel like three level chords are better implemented natively. |
verification steps:
[1] How to add a keybinding (if you're not familiar) contents of your
|
Very cool! |
Wow.. so happy I found this -- thank you! |
Indeed, I will update the docs soon |
@ulugbekna thank you! |
This was actually developed by @ dyedgreen |
Steps to Reproduce:
Expected: 3 steps key-chords should work.
The text was updated successfully, but these errors were encountered: