return { { "sindrets/diffview.nvim", keys = { { "gF", "DiffviewFileHistory", desc = "File History (Diff)" }, { "gd", "DiffviewOpen", desc = "Diff View" }, }, opts = function(_, opts) local actions = require("diffview.actions") opts.enhanced_diff_hl = true opts.view = { default = { winbar_info = true }, file_history = { winbar_info = true }, } opts.hooks = { diff_buf_read = function(bufnr) vim.b[bufnr].view_activated = false end, } opts.keymaps = { --stylua: ignore view = { { "n", "gCo", actions.conflict_choose("ours"), { desc = "Choose the OURS version of a conflict" } }, { "n", "gCt", actions.conflict_choose("theirs"), { desc = "Choose the THEIRS version of a conflict" } }, { "n", "gCb", actions.conflict_choose("base"), { desc = "Choose the BASE version of a conflict" } }, { "n", "gCa", actions.conflict_choose("all"), { desc = "Choose all the versions of a conflict" } }, { "n", "gCx", actions.conflict_choose("none"), { desc = "Delete the conflict region" } }, { "n", "gCO", actions.conflict_choose_all("ours"), { desc = "Choose the OURS version of a conflict for the whole file" } }, { "n", "gCT", actions.conflict_choose_all("theirs"), { desc = "Choose the THEIRS version of a conflict for the whole file" } }, { "n", "gCB", actions.conflict_choose_all("base"), { desc = "Choose the BASE version of a conflict for the whole file" } }, { "n", "gCA", actions.conflict_choose_all("all"), { desc = "Choose all the versions of a conflict for the whole file" } }, { "n", "gCX", actions.conflict_choose_all("none"), { desc = "Delete the conflict region for the whole file" } }, }, --stylua: ignore file_panel = { { "n", "gCO", actions.conflict_choose_all("ours"), { desc = "Choose the OURS version of a conflict for the whole file" } }, { "n", "gCT", actions.conflict_choose_all("theirs"), { desc = "Choose the THEIRS version of a conflict for the whole file" } }, { "n", "gCB", actions.conflict_choose_all("base"), { desc = "Choose the BASE version of a conflict for the whole file" } }, { "n", "gCA", actions.conflict_choose_all("all"), { desc = "Choose all the versions of a conflict for the whole file" } }, { "n", "gCX", actions.conflict_choose_all("none"), { desc = "Delete the conflict region for the whole file" } }, }, } end, }, { "folke/which-key.nvim", opts = { defaults = { ["gC"] = { name = "conflicts" }, }, }, }, }