vscode-which-key icon indicating copy to clipboard operation
vscode-which-key copied to clipboard

Show key bindings in menus

Open tshort opened this issue 2 years ago • 2 comments

Problem

I like how the normal VS Code command menu shows key bindings on the right side of the quick-pick menu. It's a useful way to learn keyboard shortcuts.

Solution

Could which-key optionally do the same?

tshort avatar Nov 13 '21 19:11 tshort

Sorry for the late reply. It is unlikely to be implemented atm.

  1. There isn't really a API from vscode we can use to read all shortcuts
  2. Shortcuts have context (when) associated to them.

The best we can do is probably

  1. Put it as parenthesis next the name of the binding like the follow
{
	"key": "J",
	"name": "Move lines down (Ctrl + x)",
	"command": "editor.action.moveLinesDownAction",
}
  1. Have another property in the binding object like the following (but it won't account for user modified shortcuts)
{
	"key": "J",
	"name": "Move lines down",
	"command": "editor.action.moveLinesDownAction",
        "shortcuts": {
                "win": "Ctrl+x",
                "mac": "Cmd+x"
        }
}

stevenguh avatar Dec 21 '21 02:12 stevenguh

Thanks for looking! It's probably best not to do anything. I'd rather not see key bindings that might be wrong.

tshort avatar Dec 23 '21 00:12 tshort