Skip to content

Commit aa015eb

Browse files
committed
[Neovim] Remove PackClean command
I like the idea of a command that will remove unused plugins. Unfortunately it operates based on which plugins have been registered. As I only register some of the plugins through autocommands, `:PackClean` can remove plugins I actively use. Until I can come up with a better way to do this, I'm removing the command.
1 parent d52b799 commit aa015eb

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

.config/nvim/plugin/init.lua

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
vim.api.nvim_create_user_command("PackClean", function()
2-
local inactive = vim
3-
.iter(vim.pack.get())
4-
:filter(function(plugin)
5-
return not plugin.active
6-
end)
7-
:map(function(plugin)
8-
return plugin.spec.name
9-
end)
10-
:totable()
11-
12-
if #inactive > 0 then
13-
vim.pack.del(inactive)
14-
end
15-
end, {
16-
desc = "Uninstall plugins not included in the pack.",
17-
})
18-
191
vim.api.nvim_create_user_command("PackRestore", function()
202
vim.pack.update(nil, { target = "lockfile", force = true })
213
end, {

0 commit comments

Comments
 (0)