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

feature: Set percents for margin #436

Closed
1 task done
Shatur opened this issue Apr 16, 2023 · 2 comments · Fixed by #440
Closed
1 task done

feature: Set percents for margin #436

Shatur opened this issue Apr 16, 2023 · 2 comments · Fixed by #440
Labels
enhancement New feature or request

Comments

@Shatur
Copy link

Shatur commented Apr 16, 2023

Did you check the docs?

  • I have read all the which-key.nvim docs

Is your feature request related to a problem? Please describe.

which-key.nvim is awesome, but it takes too much space on the screen when displayed.

Describe the solution you'd like

I would like to display it like in Helix:
изображение

Here is what I currently use:

require('which-key').setup({
  window = {
    margin = { 1, 100, 1, 0 },
  },
})

It results in the following:
изображение
But it depends on the window size, for example if I maximize the window it will look this way:
изображение

Describe alternatives you've considered

As alternative we could have an option to display whichkey.nvim vertically.

Additional context

No response

@Shatur Shatur added the enhancement New feature or request label Apr 16, 2023
@KnockerPulsar
Copy link

Similar to #320. I'd also like this feature.

@folke
Copy link
Owner

folke commented Apr 17, 2023

Just implemented this. Margin values between 0 and 1 will be a percentage of the screen size:

Use the values below to get something similar to what you want:

{
      window = { margin = { 1, 0, 0, 0.6 } },
      layout = { height = { min = 4, max = 75 } },
}

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

Successfully merging a pull request may close this issue.

3 participants