]> git.rmz.io Git - dotfiles.git/blob - nvim/lua/rmz/util/lazy.lua
lazyvim: extract opts function into util/lazy
[dotfiles.git] / nvim / lua / rmz / util / lazy.lua
1 ---@class rmz.util.lazy
2 local M = {}
3
4 ---@param name string
5 function M.get_plugin(name)
6 return require("lazy.core.config").spec.plugins[name]
7 end
8
9 ---@param name string
10 function M.opts(name)
11 local plugin = M.get_plugin(name)
12 if not plugin then
13 return {}
14 end
15 local Plugin = require("lazy.core.plugin")
16 return Plugin.values(plugin, "opts", false)
17 end
18
19 return M