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

Add support for grouped keys #1063

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add support for grouped keys #1063

wants to merge 2 commits into from

Conversation

musjj
Copy link

@musjj musjj commented Sep 10, 2022

If you have a lot of keys that you want to use for lazy loading, your config can become a bit hairy:

use {
  "FooBar/Baz",
  keys = {
    { "n", "a" },
    { "n", "b" },
    { "n", "c" },
    { "n", "d" },
    { "v", "e" },
    { "v", "f" },
    { "v", "g" },
    { "v", "h" },
  },
}

With this PR, you can now instead group your keys like this:

use {
  "FooBar/Baz",
  keys = {
    n = { "a", "b", "c", "d" },
    v = { "e", "f", "g", "h" },
  },
}

@musjj
Copy link
Author

musjj commented Dec 12, 2022

Anything blocking this from getting merged?
To clarify, this PR is backwards-compatible with the original way of specifying keys.

Copy link
Owner

@wbthomason wbthomason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Sorry for not seeing this before now. I think this is mostly good to go, but the updated language in the docs is technically incorrect, so we need to fix that before merging.

I'll have limited internet for the next week, but please @ me if you get to this and I haven't responded by Dec 21.

README.md Outdated
@@ -523,7 +523,11 @@ with `bax` filetype.

#### Keybindings

Plugins may be lazy-loaded on the use of keybindings/maps. Individual keybindings are specified either as a string (in which case they are treated as normal mode maps) or a table in the format `{mode, map}`.
Plugins may be lazy-loaded on the use of keybindings/maps. Individual keybindings are specified either as a string (in which case they are treated as normal mode maps) or a table in one of the following formats:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and in the doc/ file, we need to change the wording a bit. It currently only talks about individual keybindings, but we want to say that you can specify the whole set of keybindings in one of these two table formats, not individual keybindings.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply! Do you think they're clearer now?

@XXiaoA
Copy link

XXiaoA commented Dec 16, 2022

Hey @musjj! thanks for your great PR, which I really need. Therefore, when will we fix the docs?🤗

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

Successfully merging this pull request may close these issues.

None yet

3 participants