polirritmico/telescope-lazy-plugins.nvim

[Help] Usage with `LazyVim` distribution

Closed this issue · 1 comments

I'm currently using the LazyVim distribution, I'm not sure on how I should configure the lazy_config and lazy_spec_table parameters. I would like to kindly ask for help, if possible.

I created this config and it is working good:

return {
  {
    "polirritmico/telescope-lazy-plugins.nvim",
    cmd = "Telescope lazy_plugins",
    keys = {
      { ",G", "<Cmd>Telescope lazy_plugins<CR>", desc = "Lazy Plugins" },
    },
    dependencies = {
      "nvim-telescope/telescope.nvim",
      opts = function(_, opts)
        local lp_actions = require("telescope").extensions.lazy_plugins.actions
        local def_opts = {
          name_only = true, -- match only the `repo_name`, false to match the full `account/repo_name`
          show_disabled = true, -- also show disabled plugins from the Lazy spec.
          lazy_config = vim.fn.stdpath("config") .. "/lua/config/lazy.lua", -- path to the file containing the lazy opts and setup() call.
          lazy_spec_table = vim.fn.stdpath("config") .. "/lua/config/lazy.lua", -- path to the file containing the lazy plugin spec table.
          picker_opts = {
            sorting_strategy = "ascending",
            layout_strategy = "flex",
            layout_config = {
              flex = { flip_columns = 150 },
              horizontal = { preview_width = { 0.55, max = 100, min = 30 } },
              vertical = { preview_cutoff = 20, preview_height = 0.5 },
            },
          },
          mappings = {
            ["i"] = {
              ["<C-g>"] = lp_actions.open_repo_url,
              ["<LeftMouse>"] = lp_actions.nothing,
            },
            ["n"] = {
              ["g"] = lp_actions.open_repo_url,
              ["<LeftMouse>"] = lp_actions.nothing,
            },
          },
        }

        local my_opts = {
          lazy_plugins = {}
        }

        opts.extensions = vim.tbl_deep_extend("force", opts.extensions or {}, my_opts)
      end,
    },
    enabled = true,
  },