diff --git a/modules/cli/tools/jujutsu.nix b/modules/cli/tools/jujutsu.nix index 4b4163f..27c1aef 100644 --- a/modules/cli/tools/jujutsu.nix +++ b/modules/cli/tools/jujutsu.nix @@ -31,6 +31,9 @@ "closest_bookmark(to)" = "heads(::to & bookmarks())"; "closest_pushable(to)" = ''heads(::to & mutable() & ~description(exact:" ") & (~empty() | merges()))''; }; + ui = { + conflict-marker-style = "git"; + }; }; }; } diff --git a/modules/cli/zsh/default.nix b/modules/cli/zsh/default.nix index 043b6e5..a908678 100644 --- a/modules/cli/zsh/default.nix +++ b/modules/cli/zsh/default.nix @@ -69,6 +69,7 @@ jsp = "jj split"; jspi = "jj split -i"; jt = "jj tug"; + ju = "jj undo"; # k8s k = "kubectl"; diff --git a/nvim/default.nix b/nvim/default.nix index fb077cc..5a14df2 100644 --- a/nvim/default.nix +++ b/nvim/default.nix @@ -79,7 +79,7 @@ in jj-nvim vim-fugitive vim-rhubarb - git-conflict-nvim + unclash-nvim nvim-surround mini-operators diff --git a/nvim/lua/plugins/git.lua b/nvim/lua/plugins/git.lua index 51f3d9c..b82c31e 100644 --- a/nvim/lua/plugins/git.lua +++ b/nvim/lua/plugins/git.lua @@ -65,22 +65,20 @@ return { }, { - "git-conflict.nvim", + "unclash.nvim", -- load on enter to detect + highlight conflicts - -- lazy loading make it not work, idk why - -- event = { "BufReadPost", "BufWritePost", "BufNewFile" }, - opts = { - default_mappings = { - ours = 'c<', - theirs = 'c>', - none = 'cd', - both = 'c=', - next = ']x', - prev = '[x', - }, - }, + opts = { }, after = function(plug) - require("git-conflict").setup(plug.opts) + require("unclash").setup(plug.opts) + + local unclash = require("unclash") + vim.keymap.set("n", "]x", unclash.next_conflict, { desc = "Next Conflict" }) + vim.keymap.set("n", "[x", unclash.prev_conflict, { desc = "Prev Conflict" }) + vim.keymap.set("n", "co", unclash.open_merge_editor, { desc = "Open Merge Editor" }) + vim.keymap.set("n", "c<", unclash.accept_current, { desc = "Accept Current" }) + vim.keymap.set("n", "c>", unclash.accept_incoming, { desc = "Accept Incoming" }) + vim.keymap.set("n", "c=", unclash.accept_both, { desc = "Accept Both" }) + vim.keymap.set("n", "x", "UnclashQf", { desc = "Add conflicts in qf" }) end },