Skip to content

Commit e2d1af0

Browse files
matkladstevenguh
andauthored
Show how to achieve several menus with whichkey (#69)
Co-authored-by: Steven Guh <3455662+stevenguh@users.noreply.github.com>
1 parent a57979f commit e2d1af0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/whichkey/extra.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@ You can set `whichkey.delay` in `settings.json` to a value in milliseconds to de
3232

3333
You can set `whichkey.sortOrder` in `settings.json` to `alphabetically` to always display the menu items alphabetically.
3434

35+
## Bind shortcuts to submenu
36+
37+
To open a submenu with a shortcut, one can execute a [`whichkey.triggerKey`](./reference.md#trigger-key) command right after [`whichkey.show`](./reference.md#show).
38+
Here's an example `keybindings.json` using [ryuta46.multi-command](https://marketplace.visualstudio.com/items?itemName=ryuta46.multi-command):
39+
40+
```json
41+
{
42+
"key": "alt+s",
43+
"command": "extension.multiCommand.execute",
44+
"args": {
45+
"sequence": [
46+
"whichkey.show",
47+
{ "command": "whichkey.triggerKey", "args": "s" },
48+
]
49+
}
50+
}
51+
```
52+
3553
## Unclear selection
3654

3755
Selected text can be hard to see when the which-key menu is active due to your current theme's `inactiveSelectionBackground` config.

0 commit comments

Comments
 (0)