From fc09c6d0a9616e8bbf43b65020bc8ba638ad13eb Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:09 +0100 Subject: refactor(nvim): keep PackUpdate confirm buffer visible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Auto-writing it defeated the purpose — no feedback on what changed. Now :PackUpdate and :PackSync show the confirm buffer; user reviews and :w to apply or :q to cancel. Matches vim.pack's intended UX. --- dot_config/nvim/lua/config/pack.lua | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'dot_config/nvim') diff --git a/dot_config/nvim/lua/config/pack.lua b/dot_config/nvim/lua/config/pack.lua index 6573416..4afb63e 100644 --- a/dot_config/nvim/lua/config/pack.lua +++ b/dot_config/nvim/lua/config/pack.lua @@ -21,13 +21,6 @@ local function clean() vim.pack.del(names) end -local function update() - vim.pack.update() - if vim.bo.filetype == "nvim-pack" then - vim.cmd("silent write") - end -end - local function list() local plugs = vim.pack.get() table.sort(plugs, function(a, b) @@ -64,15 +57,15 @@ vim.api.nvim_create_user_command("PackClean", clean, { desc = "Remove plugins not declared in vim.pack.add()", }) -vim.api.nvim_create_user_command("PackUpdate", update, { - desc = "Update all plugins (auto-confirms the preview buffer)", +vim.api.nvim_create_user_command("PackUpdate", vim.pack.update, { + desc = "Update all plugins (shows confirm buffer — :w to apply, :q to cancel)", }) vim.api.nvim_create_user_command("PackSync", function() clean() - update() + vim.pack.update() end, { - desc = "Clean orphan plugins then update the rest", + desc = "Clean orphan plugins then open update confirm buffer", }) vim.api.nvim_create_user_command("PackList", list, { -- cgit v1.3.1