wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
MIT License
7.75k stars 261 forks source link

Add support for grouped keys #1063

Open musjj opened 1 year ago

musjj commented 1 year ago

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 commented 1 year ago

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

XXiaoA commented 1 year ago

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