diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 62b14237..83cadffc 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -132,7 +132,7 @@ local defaults = { } M.json = { - version = 4, + version = 5, data = { version = nil, ---@type string? news = {}, ---@type table diff --git a/lua/lazyvim/plugins/extras/lazyrc.lua b/lua/lazyvim/plugins/extras/lazyrc.lua deleted file mode 100644 index 24d06b51..00000000 --- a/lua/lazyvim/plugins/extras/lazyrc.lua +++ /dev/null @@ -1,38 +0,0 @@ ---[[ -Enable project-specific plugin specs. - -File .lazy.lua: - is read when present in the current working directory - should return a plugin spec - has to be manually trusted for each instance of the file - -This extra should be the last plugin spec added to lazy.nvim - -See: - :h 'exrc' - :h :trust ---]] -local filepath = vim.fn.fnamemodify(".lazy.lua", ":p") -local file = vim.secure.read(filepath) -if not file then - return {} -end - -vim.api.nvim_create_autocmd("User", { - pattern = "VeryLazy", - once = true, - callback = function() - local Config = require("lazy.core.config") - local lazyrc_idx = LazyVim.plugin.extra_idx("lazyrc") - - if lazyrc_idx and lazyrc_idx ~= #Config.spec.modules then - LazyVim.warn({ - "The `lazyrc` extra must be the last plugin spec added to **lazy.nvim**. ", - "", - "Add `{ import = 'lazyvim.plugins.extras.lazyrc' }` to file `config.lazy`. ", - "Do not use the `LazyExtras` command. ", - }, { title = "LazyVim", once = true }) - end - end, -}) -return loadstring(file)() diff --git a/lua/lazyvim/util/json.lua b/lua/lazyvim/util/json.lua index 4196847e..3e17662e 100644 --- a/lua/lazyvim/util/json.lua +++ b/lua/lazyvim/util/json.lua @@ -85,6 +85,10 @@ function M.migrate() or extra == "lazyvim.plugins.extras.ui.treesitter-rewrite" ) end, json.data.extras or {}) + elseif json.data.version == 4 then + json.data.extras = vim.tbl_filter(function(extra) + return not (extra == "lazyvim.plugins.extras.lazyrc") + end, json.data.extras or {}) end M.save() diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index a1cb8f46..77a1c28e 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -13,6 +13,7 @@ M.deprecated_extras = { ["lazyvim.plugins.extras.coding.native_snippets"] = "Native snippets are now the default for **Neovim >= 0.10**", ["lazyvim.plugins.extras.ui.treesitter-rewrite"] = "Disabled `treesitter-rewrite` extra for now. Not ready yet.", ["lazyvim.plugins.extras.coding.mini-ai"] = "`mini.ai` is now a core LazyVim plugin (again)", + ["lazyvim.plugins.extras.lazyrc"] = "local spec files are now a lazy.nvim feature", } M.deprecated_modules = {