mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-26 18:59:00 +02:00
refactor: use LazyVim.opts
This commit is contained in:
parent
58cf6f971b
commit
76f9dbb40c
3 changed files with 3 additions and 7 deletions
|
@ -6,8 +6,7 @@ return {
|
||||||
"echasnovski/mini.surround",
|
"echasnovski/mini.surround",
|
||||||
keys = function(_, keys)
|
keys = function(_, keys)
|
||||||
-- Populate the keys based on the user's options
|
-- Populate the keys based on the user's options
|
||||||
local plugin = require("lazy.core.config").spec.plugins["mini.surround"]
|
local opts = LazyVim.opts("mini.surround")
|
||||||
local opts = require("lazy.core.plugin").values(plugin, "opts", false)
|
|
||||||
local mappings = {
|
local mappings = {
|
||||||
{ opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } },
|
{ opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } },
|
||||||
{ opts.mappings.delete, desc = "Delete Surrounding" },
|
{ opts.mappings.delete, desc = "Delete Surrounding" },
|
||||||
|
|
|
@ -54,9 +54,7 @@ return {
|
||||||
priority = 100,
|
priority = 100,
|
||||||
primary = true,
|
primary = true,
|
||||||
format = function(buf)
|
format = function(buf)
|
||||||
local plugin = require("lazy.core.config").plugins["conform.nvim"]
|
local opts = LazyVim.opts("conform.nvim")
|
||||||
local Plugin = require("lazy.core.plugin")
|
|
||||||
local opts = Plugin.values(plugin, "opts", false)
|
|
||||||
require("conform").format(LazyVim.merge({}, opts.format, { bufnr = buf }))
|
require("conform").format(LazyVim.merge({}, opts.format, { bufnr = buf }))
|
||||||
end,
|
end,
|
||||||
sources = function(buf)
|
sources = function(buf)
|
||||||
|
|
|
@ -106,8 +106,7 @@ return {
|
||||||
---@param opts PluginLspOpts
|
---@param opts PluginLspOpts
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
if LazyVim.has("neoconf.nvim") then
|
if LazyVim.has("neoconf.nvim") then
|
||||||
local plugin = require("lazy.core.config").spec.plugins["neoconf.nvim"]
|
require("neoconf").setup(LazyVim.opts("neoconf.nvim"))
|
||||||
require("neoconf").setup(require("lazy.core.plugin").values(plugin, "opts", false))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- setup autoformat
|
-- setup autoformat
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue