From afaad61c4405b23571e7ebbaf357ebbc554ac726 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 6 Nov 2026 10:07:06 +0100 Subject: [PATCH] better git stash --- nvim/.config/nvim/lua/romanzy/commands.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nvim/.config/nvim/lua/romanzy/commands.lua b/nvim/.config/nvim/lua/romanzy/commands.lua index a05752f..9a52182 100644 --- a/nvim/.config/nvim/lua/romanzy/commands.lua +++ b/nvim/.config/nvim/lua/romanzy/commands.lua @@ -17,6 +17,14 @@ uc("NormFormat", "!c_formatter_42 *.c *.h", { desc = "comply with the norm in C" vim.cmd("cnoreabbrev wn noautocmd write") +uc("GitBackup", function(opts) + vim.fn.system({ "git", "stash", "push", "-m", opts.args }) + vim.fn.system({ "git", "stash", "apply", "--index", "stash@{0}" }) +end, { + nargs = 1, + desc = "Stash changes without affecting the status", +}) + -- ac("LspAttach", { -- desc = "Notify user about attached LSP clients", -- group = aug("LSPOnAttach", { clear = true }),