From da3b5159df326bc31d5a0ebdfa2c5cbbd32df9d2 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 10 Feb 2025 12:14:05 +0100 Subject: [PATCH] feat(config): add option to disable the order check to warning message --- lua/lazyvim/config/init.lua | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 42afd66a..5ef66fd8 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -229,11 +229,18 @@ function M.setup(opts) local extras = find("^lazyvim%.plugins%.extras%.", true) or lazyvim_plugins local plugins = find("^plugins$") or math.huge if lazyvim_plugins ~= 1 or extras > plugins then - vim.notify( - "The order of your `lazy.nvim` imports is incorrect:\n- `lazyvim.plugins` should be first\n- followed by any `lazyvim.plugins.extras`\n- and finally your own `plugins`", - "warn", - { title = "LazyVim" } - ) + local msg = { + "The order of your `lazy.nvim` imports is incorrect:", + "- `lazyvim.plugins` should be first", + "- followed by any `lazyvim.plugins.extras`", + "- and finally your own `plugins`", + "", + "If you think you know what you're doing, you can disable this check with:", + "```lua", + "vim.g.lazyvim_check_order = false", + "```", + } + vim.notify(table.concat(msg, "\n"), "warn", { title = "LazyVim" }) end end, })