From 8d2824b0a4728966cad4799bbc5053049c4cc0b7 Mon Sep 17 00:00:00 2001 From: cg8936 Date: Fri, 16 May 2025 12:09:14 -0400 Subject: [PATCH] feat: adding git conflicts --- lua/cargdev/core/keymaps.lua | 9 +++++++++ lua/cargdev/plugins/gitConflicts.lua | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 lua/cargdev/plugins/gitConflicts.lua diff --git a/lua/cargdev/core/keymaps.lua b/lua/cargdev/core/keymaps.lua index 5d681df..ea15751 100644 --- a/lua/cargdev/core/keymaps.lua +++ b/lua/cargdev/core/keymaps.lua @@ -77,3 +77,12 @@ keymap.set("v", "zr", ":CopilotChatReview", { desc = "Review code (C keymap.set("v", "zf", ":CopilotChatFix", { desc = "Fix code issues (Copilot Chat)" }) keymap.set("v", "zo", ":CopilotChatOptimize", { desc = "Optimize code (Copilot Chat)" }) keymap.set("v", "zd", ":CopilotChatDocs", { desc = "Generate docs (Copilot Chat)" }) + +-- Git Conflict Mappings +keymap.set("n", "]x", "(git-conflict-next-conflict)", { desc = "Go to next git conflict" }) +keymap.set("n", "[x", "(git-conflict-prev-conflict)", { desc = "Go to previous git conflict" }) +keymap.set("n", "co", "(git-conflict-ours)", { desc = "Choose ours (git conflict)" }) +keymap.set("n", "ct", "(git-conflict-theirs)", { desc = "Choose theirs (git conflict)" }) +keymap.set("n", "cb", "(git-conflict-both)", { desc = "Choose both (git conflict)" }) +keymap.set("n", "c0", "(git-conflict-none)", { desc = "Choose none (git conflict)" }) +keymap.set("n", "cq", "(git-conflict-list)", { desc = "List all git conflicts" }) diff --git a/lua/cargdev/plugins/gitConflicts.lua b/lua/cargdev/plugins/gitConflicts.lua new file mode 100644 index 0000000..1d706b3 --- /dev/null +++ b/lua/cargdev/plugins/gitConflicts.lua @@ -0,0 +1,13 @@ +return { + "akinsho/git-conflict.nvim", + config = function() + require("git-conflict").setup({ + default_mappings = true, -- enable buffer local mapping created by this plugin + disable_diagnostics = true, -- This will disable diagnostics in a buffer whilst it is conflicted + highlights = { -- They must have background color, otherwise the default color will be used + incoming = "DiffText", + current = "DiffAdd", + }, + }) + end, +}