return { { "lewis6991/gitsigns.nvim", event = { "BufReadPre", "BufNewFile" }, opts = { signs = { add = { text = "▕" }, change = { text = "▕" }, delete = { text = "󰐊" }, topdelete = { text = "󰐊" }, changedelete = { text = "▕" }, untracked = { text = "▕" }, }, -- Preview feature to enable signs with staged hunks. _signs_staged_enable = true, 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 map("n", "]h", gs.next_hunk, "Next Hunk") map("n", "[h", gs.prev_hunk, "Prev Hunk") map({ "n", "v" }, "ga", ":Gitsigns stage_hunk", "Add Hunk") map({ "n", "v" }, "gr", ":Gitsigns reset_hunk", "Reset Hunk") map("n", "gu", gs.undo_stage_hunk, "Unstage Hunk") map("n", "gA", gs.stage_buffer, "Add buffer") map("n", "gB", gs.blame_line, "Blame") map("n", "gR", gs.reset_buffer, "Reset Buffer") map("n", "gp", gs.preview_hunk, "Preview Hunk") map("n", "gd", gs.diffthis, "Diff This") map("n", "gD", function() gs.diffthis("~") end, "Diff This ~") map({ "o", "x" }, "ih", ":Gitsigns select_hunk", "Git Select Hunk") end, }, }, { "akinsho/git-conflict.nvim", event = "VeryLazy", keys = { { "gxo", "(git-conflict-ours)", desc = "Accept ours" }, { "gxt", "(git-conflict-theirs)", desc = "Accept theirs" }, { "gxb", "(git-conflict-both)", desc = "Accept both" }, { "gx0", "(git-conflict-none)", desc = "Accept none" }, { "]x", "(git-conflict-prev-conflict)", desc = "Previous conflict" }, { "[x", "(git-conflict-next-conflict)", desc = "Next conflict" }, }, opts = { default_mappings = false, }, } }