diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua index 8d3c8930..5c31cff0 100644 --- a/.config/nvim/lua/config/lazy.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -12,6 +12,7 @@ require("lazy").setup({ -- add LazyVim and import its plugins { "LazyVim/LazyVim", import = "lazyvim.plugins" }, { import = "plugins" }, + { import = "plugins.extras.util.lazyrc" }, }, defaults = { -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. diff --git a/.config/nvim/lua/plugins/extras/util/lazyrc.lua b/.config/nvim/lua/plugins/extras/util/lazyrc.lua new file mode 100644 index 00000000..4ae88441 --- /dev/null +++ b/.config/nvim/lua/plugins/extras/util/lazyrc.lua @@ -0,0 +1,39 @@ +--[[ +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 Util = require("lazyvim.util") + local lazyrc_idx = Util.plugin.extra_idx("lazyrc") + + if lazyrc_idx and lazyrc_idx ~= #Config.spec.modules then + Util.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/.github/README.md b/.github/README.md index f3c31769..abaaa273 100644 --- a/.github/README.md +++ b/.github/README.md @@ -50,7 +50,7 @@ I've been working on this for a long time so I hope you like it! - :scroll: Scratchpads - :bell: Notification Center -- :zzz: Neovim powered by LazyVim with custom extras added +- :zzz: Neovim powered by LazyVim with custom extras added (More than 200!) - :dark_sunglasses: Dark Mode for the whole system - :framed_picture: Various Wallpapers - :nerd_face: Nerd Fonts for the Shell Prompt