VSpaceCode / vscode-which-key

which-key like menu for Visual Studio Code
https://vspacecode.github.io/docs/whichkey
MIT License
166 stars 18 forks source link

Is there a way to have bindings without a doc, and vice versa? #87

Open quicknir opened 6 months ago

quicknir commented 6 months ago

The bindings you often see for 0-9 to do something with the Nth vertical window take a lot of space. IIRC, in Spacemacs, it was possible to have the bindings 0-9 and have them "hidden", and then have an entry that simply said "[0-9] Switch to the nth buffer" or whatever. Is there any way to do that here?

stevenguh commented 4 months ago

I think you can hide them using the DisplayOption (e.g. "display": "hidden")

Example in overrides:

{
  "whichkey.bindingOverrides": [
    {
      "keys": "g.s",
      "name": "Go to line",
      "type": "command",
      "display": "hidden",
      "command":"workbench.action.gotoLine",
    }
  ]
}
quicknir commented 2 weeks ago

@stevenguh Hey sorry I didn't respond for so long. display hidden is extremely useful, thank you! Hoping to also do the reverse though. Here's what I tried

        {
            "keys": "b.0-9",
            "name": "Select nth buffer",
            "icon": "arrow-both",
            "type": "command",
        },

This actually works ok, the problem is that the "0-9" seems to be too many characters, and it ends up shifting the description right even though there's still lots of space on the left. if I drop the icon though, then it does work out pretty well!

stevenguh commented 2 weeks ago

I am surprised "0-9" works for you. I would assume you have to have the override binding for each item like one for 0, one for 1, ..., 9.

But yeah we used \t to align for variable width fonts, so when there is multiple characters, it can get out of alignment.