require("gitsigns").setup({ signs = { add = { text = "▎" }, change = { text = "▎" }, delete = { text = "▎" }, topdelete = { text = "▎" }, changedelete = { text = "▎" }, untracked = { text = "▎" }, }, on_attach = function(buffer) local gs = package.loaded.gitsigns local function map(mode, l, r, desc) vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc }) end -- stylua: ignore start map("n", "]g", gs.next_hunk, "Next git hunk") map("n", "[g", gs.prev_hunk, "Previous git hunk") map("n", "gh", gs.reset_hunk, "Reset Git Hunk") map("n", "gr", gs.reset_buffer, "Reset Git Buffer") map("n", "gs", gs.stage_hunk, "Stage Git Hunk") map("n", "gS", gs.stage_buffer, "Stage Git Buffer") map("n", "gu", gs.undo_stage_hunk, "UnStage Git Hunk") map("n", "gd", gs.diffthis, "View Git Diff") end, })