aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dot_config
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:09 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:09 +0100
commitfc09c6d0a9616e8bbf43b65020bc8ba638ad13eb (patch)
tree9ef2f83a67651e330450ffd8f52f4a11a0125c51 /dot_config
parentae03454361bb9e50a509823a1587fbb2dd88d3c8 (diff)
downloaddotfiles-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')
-rw-r--r--dot_config/nvim/lua/config/pack.lua15
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, {