-
Notifications
You must be signed in to change notification settings - Fork 19
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
triggerKey Not Firing from edamagit #62
Comments
I think I missed that caveat. That said is there a way to trigger a submenu without which-key already visible? |
Found one solution: {
"key": "shift+2",
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
"vspacecode.space",
{ "command": "whichkey.triggerKey", "args": "@" },
],
},
"when": "!whichKeyVisible && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
}, It works! But downside is requires the multiCommand extension. If there's a cleaner way, I'd love to see a better solution |
Let me make sure I understand the problem. You are trying to have Your workaround is probably the best bet currently. I thought about adding keys sequence to the |
Also, per buffer remapping in vim was mentioned on VSCodeVim/Vim#4765 (comment) |
That’s correct.
I’m willing to give a PR for that a shot if you’re open to it. Will try the per-buffer remapping approach as well |
Sure :) Let me know if you have any questions.
Unfortunately, that's just a thread mentioning that functionality doesn't exist today. |
Great will do!
Oh my mistake, I misunderstood there but your reply probably just saved me a good chunk of time 😅 |
Bug description
Trying to create some bindings to recreate the use of forge to manage pull-requests. Reading the docs suggests triggerKey should do the job. If I bind it from settings.json to go through the
normalModeKeyBindingsNonRecursive
it works, but it rebinds the key everywhere.Ideally the triggerKey binding should only function when in a magit buffer. I copied an example from how the
x
key is bound in magit like the following:To Reproduce
keybindings.json
and add the following:SPC g s
by default I think?shift+2
or@
Expected behavior
Given the configuration, my understanding is that it should trigger the window menu (
SPC w
) to open in the magit buffer. I'm using the window menu for test purposes but it shouldn't matter which menu is chosen, it has not worked with any of them.Actual behavior
Nothing happens, the magit buffer stays open and I don't see the which-key menu.
Additional context
By replacing the command with
workbench.action.showCommands
the binding works and the command panel is displayed as expected which suggestswhichkey.triggerKey
is firing.If you add the following to
settings.json
in avim.normalModeKeyBindingsNonRecursive
:And press
@
anywhere, it works as expected showing the window menuKeybindings
Click to toggle contents of `keybindings.json`
Settings
My settings file is gigantic right now having a copy of all the default which-key-bindings and is 7k lines long about 360 kb.
I've attached it in a zip manually below
settings.json.zip
System information
This tool is still great and I'm looking forward to using it more! 🙂
The text was updated successfully, but these errors were encountered: