From 90237e41bd667d7e7e84594aaf12b6b46b0c8cf9 Mon Sep 17 00:00:00 2001 From: rootiest Date: Sat, 31 Aug 2024 02:55:40 -0400 Subject: [PATCH] feat: add function to reload all plugins with exclusion list --- lua/data/func.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lua/data/func.lua b/lua/data/func.lua index ad823e7..576eec8 100644 --- a/lua/data/func.lua +++ b/lua/data/func.lua @@ -145,6 +145,21 @@ end function M.notify(message, level) level = level or "info" vim.notify(message, vim.log.levels[level:upper()]) +--- Function to reload all plugins. +--- @return nil +function M.reload_all_plugins() + -- Define the exclusion list + local exclude = require("data").types.plugin_reloader.exclusion_list + + -- Get the list of currently loaded plugins + local plugins = require("lazy.core.config").plugins + + -- Iterate over each plugin and reload it if it's not in the exclusion list + for plugin_name, _ in pairs(plugins) do + if not exclude[plugin_name] then + vim.cmd("Lazy reload " .. plugin_name) + end + end end -- Check if plugin is installed