diff options
| author | 2026-05-13 13:43:09 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:09 +0100 | |
| commit | fc09c6d0a9616e8bbf43b65020bc8ba638ad13eb (patch) | |
| tree | 9ef2f83a67651e330450ffd8f52f4a11a0125c51 /dot_config/nvim/lua | |
| parent | ae03454361bb9e50a509823a1587fbb2dd88d3c8 (diff) | |
| download | dotfiles-fc09c6d0a9616e8bbf43b65020bc8ba638ad13eb.tar.gz dotfiles-fc09c6d0a9616e8bbf43b65020bc8ba638ad13eb.tar.bz2 dotfiles-fc09c6d0a9616e8bbf43b65020bc8ba638ad13eb.zip | |
refactor(nvim): keep PackUpdate confirm buffer visible
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.
Diffstat (limited to 'dot_config/nvim/lua')
| -rw-r--r-- | dot_config/nvim/lua/config/pack.lua | 15 |
1 files changed, 4 insertions, 11 deletions
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, { |
