Generate vscode which-key config automatically
- enable
vscode-whichkey-config-gen
- add a
names
field to yourvim.normalModeKeyBindingsNonRecursive
(generate which-key hint title) - replace the keymap
whichkey.show
withwhichKeyConfigGen.show
And then simply remove your old which-key configs
{
- "whichkey.bindings": [
- {
- "key": "c",
- "type": "bindings",
- "name": "Go to Change...",
- "bindings": [
- {
- "key": "n",
- "name": "Next Changes",
- "type": "command",
- "command": "workbench.action.editor.nextChange"
- },
- {
- "key": "p",
- "name": "Previous Changes",
- "type": "command",
- "command": "workbench.action.editor.previousChange"
- }
- ]
- }
- ],
"vim.normalModeKeyBindingsNonRecursive": [
{
// I prefer use leader twice to avoid overlap with Vim keymap, and you can still use one leader
"before": ["leader", "leader"],
"commands": ["whichKeyConfigGen.show"]
},
{
"before": ["leader", "c", "n"],
+ "names": ["Go to Change...", "Next Change"],
"commands": ["workbench.action.editor.nextChange"]
},
{
"before": ["leader", "c", "p"],
+ "names": ["Go to Change...", "Previous Change"],
"commands": ["workbench.action.editor.previousChange"]
}
]
}
Command | Title |
---|---|
whichKeyConfigGen.show |
Which Key Config Generator: Show Menu |
whichKeyConfigGen.updateConfig |
Which Key Config Generator: Update Config |
whichKeyConfigGen.toggleEnable |
Which Key Config Generator: Toggle Enable |
Key | Description | Type | Default |
---|---|---|---|
whichKeyConfigGen.enable |
Enable which-key config generator | boolean |
true |
whichKeyConfigGen.normalModeNonRecursiveKeybindings |
Generated code, do not modify | array |
[] |
whichKeyConfigGen.visualModeNonRecursiveKeybindings |
Generated code, do not modify | array |
[] |
MIT License © 2024 Kevin Kwong