From 6cc1c703a5e371a867e1e22db6c9ff0c2a848a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Sun, 5 Oct 2025 15:28:15 +0200 Subject: [PATCH] feat: add DepsUpdateSnapSave user command --- lua/config/plugins.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lua/config/plugins.lua b/lua/config/plugins.lua index 1784cd4..b48405c 100644 --- a/lua/config/plugins.lua +++ b/lua/config/plugins.lua @@ -17,6 +17,26 @@ end -- Set up 'mini.deps' immediately to have its `now()` and `later()` helpers require("mini.deps").setup() +-- Also setup this user command to always save a new lockfile after update +vim.api.nvim_create_user_command("DepsUpdateSnapSave", function(opts) + local name = opts.args ~= "" and opts.args or nil + MiniDeps.update(name) + MiniDeps.snap_save() +end, { + desc = "Update MiniDeps plugins and save snapshot", + nargs = "?", + complete = function(arg, _, _) + local session_names = vim.tbl_map( + function(s) return s.name end, + MiniDeps.get_session() + ) + return vim.tbl_filter( + function(n) return vim.startswith(n, arg) end, + session_names + ) + end, +}) + -- Define main config table to be able to use it in scripts _G.Config = {}