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]: Parse keymaps off lazy.nvim plugin specs #377

Closed
1 task done
mrjones2014 opened this issue Jun 21, 2023 · 1 comment · Fixed by #382
Closed
1 task done

[Feature]: Parse keymaps off lazy.nvim plugin specs #377

mrjones2014 opened this issue Jun 21, 2023 · 1 comment · Fixed by #382
Assignees
Labels
enhancement New feature or request

Comments

@mrjones2014
Copy link
Owner

Similar Issues

  • Before filing, I have searched for similar issues.

Description

For example, folke/flash.nvim recommends setting up the plugin spec like this:

{
  "folke/flash.nvim",
  event = "VeryLazy",
  ---@type Flash.Config
  opts = {},
  keys = {
    {
      "s",
      mode = { "n", "x", "o" },
      function()
        require("flash").jump()
      end,
    },
    {
      "S",
      mode = { "o", "x" },
      function()
        require("flash").treesitter()
      end,
    },
  },
}

If we can use the lazy.nvim API to get those keys, and somehow also detect when they are actually mapped, then we can easily load them into legendary.

@mrjones2014 mrjones2014 added the enhancement New feature or request label Jun 21, 2023
@mrjones2014 mrjones2014 self-assigned this Jun 21, 2023
@mrjones2014
Copy link
Owner Author

We may be able to monkey-patch the parse or :_add functions from this file: https://github.com/folke/lazy.nvim/blob/main/lua/lazy/core/handler/keys.lua

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
1 participant