Skip to content
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

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

Open
quicknir opened this issue Apr 1, 2024 · 3 comments
Open

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

quicknir opened this issue Apr 1, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@quicknir
Copy link

quicknir commented Apr 1, 2024

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?

@quicknir quicknir added the enhancement New feature or request label Apr 1, 2024
@stevenguh
Copy link
Member

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
Copy link
Author

@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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants