Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lua/config/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ local function sync_packages()
print("Install all packages...")
vim.pack.add(package_list)
print("All packages installed!")
-- packages removed from package_list are left on disk by vim.pack (never
-- deleted automatically) and stay "inactive"; update() below would otherwise
-- keep re-adding their stale lock file entry on every sync, see nvim-web-devicons
local inactive = vim.iter(vim.pack.get())
:filter(function(pkg) return not pkg.active end)
:map(function(pkg) return pkg.spec.name end)
:totable()
if #inactive > 0 then
print("Prune orphaned: " .. table.concat(inactive, ", "))
vim.pack.del(inactive)
end
-- update() normally opens a confirmation buffer (:write applies it); in headless
-- mode (README setup command) that buffer would just be discarded, so apply directly
vim.pack.update(nil, { force = #vim.api.nvim_list_uis() == 0 })
Expand Down
4 changes: 0 additions & 4 deletions nvim-pack-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@
"rev": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e",
"src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects.git"
},
"nvim-web-devicons": {
"rev": "09d1324e264c6950262dbe02a9bce2933a6800db",
"src": "https://github.com/nvim-tree/nvim-web-devicons.git"
},
"obsidian.nvim": {
"rev": "bf1616d46e72477ad978051363fdb5c839c1cce5",
"src": "https://github.com/obsidian-nvim/obsidian.nvim.git"
Expand Down
Loading