aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dot_config/nvim
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:08 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:08 +0100
commitdf6f39907ab219adfe4ce63556e1501eb9b51017 (patch)
tree29526c519b95c87233d7d017cca0e6b42bbf0156 /dot_config/nvim
parentf2e2edad1b088b2fbaba49fb5a334434343fc972 (diff)
downloaddotfiles-df6f39907ab219adfe4ce63556e1501eb9b51017.tar.gz
dotfiles-df6f39907ab219adfe4ce63556e1501eb9b51017.tar.bz2
dotfiles-df6f39907ab219adfe4ce63556e1501eb9b51017.zip
feat(nvim): add :PackList to show managed plugins with rev and version
Uses vim.pack.get() and prints one line per plugin: ● (active) or ○ (orphan), name, short rev, version spec.
Diffstat (limited to 'dot_config/nvim')
-rw-r--r--dot_config/nvim/lua/config/pack.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/dot_config/nvim/lua/config/pack.lua b/dot_config/nvim/lua/config/pack.lua
index bdef872..90b530e 100644
--- a/dot_config/nvim/lua/config/pack.lua
+++ b/dot_config/nvim/lua/config/pack.lua
@@ -25,6 +25,38 @@ local function update()
vim.pack.update(nil, { force = true })
end
+local function list()
+ local plugs = vim.pack.get()
+ table.sort(plugs, function(a, b)
+ return a.spec.name < b.spec.name
+ end)
+ local lines = {}
+ for _, p in ipairs(plugs) do
+ local mark = p.active and "●" or "○"
+ local ver = p.spec.version
+ if type(ver) == "table" then
+ ver = tostring(ver)
+ end
+ table.insert(
+ lines,
+ string.format(
+ "%s %-40s %-12s %s",
+ mark,
+ p.spec.name,
+ (p.rev or ""):sub(1, 8),
+ ver or ""
+ )
+ )
+ end
+ vim.api.nvim_echo(
+ vim.tbl_map(function(l)
+ return { l .. "\n" }
+ end, lines),
+ false,
+ {}
+ )
+end
+
vim.api.nvim_create_user_command("PackClean", clean, {
desc = "Remove plugins not declared in vim.pack.add()",
})
@@ -39,3 +71,7 @@ vim.api.nvim_create_user_command("PackSync", function()
end, {
desc = "Clean orphan plugins then update the rest",
})
+
+vim.api.nvim_create_user_command("PackList", list, {
+ desc = "List managed plugins (● active, ○ orphan)",
+})