From ada5e671180fc4d05e41c6acd250d02b54d8e413 Mon Sep 17 00:00:00 2001 From: Pratik Tripathy Date: Tue, 9 Sep 2025 17:09:26 +0530 Subject: [PATCH] feat(neovim): Use gitsign keymaps to stage & unstage hunks from buffer itself --- common/.config/nvim/lua/plugins/git.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/.config/nvim/lua/plugins/git.lua b/common/.config/nvim/lua/plugins/git.lua index 5936b45..af72298 100644 --- a/common/.config/nvim/lua/plugins/git.lua +++ b/common/.config/nvim/lua/plugins/git.lua @@ -75,8 +75,10 @@ return { -- Text object map({ "o", "x" }, "ih", ":Gitsigns select_hunk", { desc = "Git: Visual select hunk" }) - map("n", "gr", gs.reset_hunk, { desc = "Git: reset hunk" }) + map("n", "gr", gs.reset_hunk, { desc = "Git: Reset hunk" }) map("n", "gp", gs.preview_hunk, { desc = "Git: Preview hunk" }) + map("n", "gs", gs.stage_hunk, { desc = "Git: Stage hunk under cursor" }) + map("n", "gu", gs.undo_stage_hunk, { desc = "Git: Unstage hunk under cursor" }) map("n", "gK", function() gs.blame_line({ full = true })