added PlugClean

This commit is contained in:
sgraves committed 2026-08-29 19:05:36 -05:00
1 parent 69ae6efc09
commit 30f16b554b
1 file changed
+32
+32
View File
@@ -38,6 +38,38 @@ vim.api.nvim_create_user_command(
{} {}
) )
vim.api.nvim_create_user_command(
"PlugClean",
function()
local stale = vim.iter(vim.pack.get())
:filter(function(plugin)
return not plugin.active
end)
:map(function(plugin)
return plugin.spec.name
end)
:totable()
if #stale == 0 then
vim.notify("No stale plugins", vim.log.levels.INFO)
return
end
table.sort(stale)
vim.pack.del(stale)
vim.notify(
string.format(
"Removed %d stale plugin%s: %s",
#stale,
#stale == 1 and "" or "s",
table.concat(stale, ", ")
),
vim.log.levels.INFO
)
end,
{}
)
if not NV_DARCULA_ENABLE_COC then if not NV_DARCULA_ENABLE_COC then
vim.api.nvim_create_user_command( vim.api.nvim_create_user_command(
"LspInfo", "LspInfo",