mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 01:38:54 +02:00
refactor: use opts
everywhere, so any plugin config can now be extended
This commit is contained in:
parent
6c73e775cf
commit
77b5e9ab56
3 changed files with 40 additions and 32 deletions
|
@ -83,8 +83,8 @@ return {
|
|||
{
|
||||
"echasnovski/mini.pairs",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("mini.pairs").setup({})
|
||||
config = function(_, opts)
|
||||
require("mini.pairs").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -92,9 +92,7 @@ return {
|
|||
{
|
||||
"echasnovski/mini.surround",
|
||||
keys = { "gz" },
|
||||
config = function()
|
||||
-- use gz mappings instead of s to prevent conflict with leap
|
||||
require("mini.surround").setup({
|
||||
opts = {
|
||||
mappings = {
|
||||
add = "gza", -- Add surrounding in Normal and Visual modes
|
||||
delete = "gzd", -- Delete surrounding
|
||||
|
@ -104,7 +102,10 @@ return {
|
|||
replace = "gzr", -- Replace surrounding
|
||||
update_n_lines = "gzn", -- Update `n_lines`
|
||||
},
|
||||
})
|
||||
},
|
||||
config = function(_, opts)
|
||||
-- use gz mappings instead of s to prevent conflict with leap
|
||||
require("mini.surround").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -113,14 +114,15 @@ return {
|
|||
{
|
||||
"echasnovski/mini.comment",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("mini.comment").setup({
|
||||
opts = {
|
||||
hooks = {
|
||||
pre = function()
|
||||
require("ts_context_commentstring.internal").update_commentstring({})
|
||||
end,
|
||||
},
|
||||
})
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("mini.comment").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
|
@ -117,8 +117,12 @@ return {
|
|||
"ggandor/leap.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = { { "ggandor/flit.nvim", opts = { labeled_modes = "nv" } } },
|
||||
config = function()
|
||||
require("leap").add_default_mappings(true)
|
||||
config = function(_, opts)
|
||||
local leap = require("leap")
|
||||
for k, v in pairs(opts) do
|
||||
leap.opts[k] = v
|
||||
end
|
||||
leap.add_default_mappings(true)
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -196,8 +200,9 @@ return {
|
|||
{
|
||||
"RRethy/vim-illuminate",
|
||||
event = "BufReadPost",
|
||||
config = function()
|
||||
require("illuminate").configure({ delay = 200 })
|
||||
opts = { delay = 200 },
|
||||
config = function(_, opts)
|
||||
require("illuminate").configure(opts)
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
|
|
|
@ -167,18 +167,19 @@ return {
|
|||
"echasnovski/mini.indentscope",
|
||||
version = false, -- wait till new 0.7.0 release to put it back on semver
|
||||
event = "BufReadPre",
|
||||
config = function()
|
||||
opts = {
|
||||
-- symbol = "▏",
|
||||
symbol = "│",
|
||||
options = { try_as_border = true },
|
||||
},
|
||||
config = function(_, opts)
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
require("mini.indentscope").setup({
|
||||
-- symbol = "▏",
|
||||
symbol = "│",
|
||||
options = { try_as_border = true },
|
||||
})
|
||||
require("mini.indentscope").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue