♻️ refactor(nvim): diffview bindings changed as well as fixed git conflict not working correctly
This commit is contained in:
parent
1d7cc9c1d0
commit
a52a496e5b
2 changed files with 53 additions and 15 deletions
|
@ -1,7 +1,44 @@
|
||||||
return {
|
return {
|
||||||
"sindrets/diffview.nvim",
|
{
|
||||||
keys = {
|
"sindrets/diffview.nvim",
|
||||||
{ "<leader>gd", "<cmd>DiffviewFileHistory<CR>", desc = "Diff File History" },
|
keys = {
|
||||||
|
{ "<leader>gd", "<cmd>DiffviewFileHistory<CR>", desc = "Diff File History" },
|
||||||
|
{ "<leader>gD", "<cmd>DiffviewOpen<CR>", desc = "Diff View Open" },
|
||||||
|
},
|
||||||
|
opts = function(_, opts)
|
||||||
|
local actions = require("diffview.actions")
|
||||||
|
|
||||||
|
opts.keymaps = {
|
||||||
|
--stylua: ignore
|
||||||
|
view = {
|
||||||
|
{ "n", "<leader>gCo", actions.conflict_choose("ours"), { desc = "Choose the OURS version of a conflict" } },
|
||||||
|
{ "n", "<leader>gCt", actions.conflict_choose("theirs"), { desc = "Choose the THEIRS version of a conflict" } },
|
||||||
|
{ "n", "<leader>gCb", actions.conflict_choose("base"), { desc = "Choose the BASE version of a conflict" } },
|
||||||
|
{ "n", "<leader>gCa", actions.conflict_choose("all"), { desc = "Choose all the versions of a conflict" } },
|
||||||
|
{ "n", "<leader>gCx", actions.conflict_choose("none"), { desc = "Delete the conflict region" } },
|
||||||
|
{ "n", "<leader>gCO", actions.conflict_choose_all("ours"), { desc = "Choose the OURS version of a conflict for the whole file" } },
|
||||||
|
{ "n", "<leader>gCT", actions.conflict_choose_all("theirs"), { desc = "Choose the THEIRS version of a conflict for the whole file" } },
|
||||||
|
{ "n", "<leader>gCB", actions.conflict_choose_all("base"), { desc = "Choose the BASE version of a conflict for the whole file" } },
|
||||||
|
{ "n", "<leader>gCA", actions.conflict_choose_all("all"), { desc = "Choose all the versions of a conflict for the whole file" } },
|
||||||
|
{ "n", "<leader>gCX", actions.conflict_choose_all("none"), { desc = "Delete the conflict region for the whole file" } },
|
||||||
|
},
|
||||||
|
--stylua: ignore
|
||||||
|
file_panel = {
|
||||||
|
{ "n", "<leader>gCO", actions.conflict_choose_all("ours"), { desc = "Choose the OURS version of a conflict for the whole file" } },
|
||||||
|
{ "n", "<leader>gCT", actions.conflict_choose_all("theirs"), { desc = "Choose the THEIRS version of a conflict for the whole file" } },
|
||||||
|
{ "n", "<leader>gCB", actions.conflict_choose_all("base"), { desc = "Choose the BASE version of a conflict for the whole file" } },
|
||||||
|
{ "n", "<leader>gCA", actions.conflict_choose_all("all"), { desc = "Choose all the versions of a conflict for the whole file" } },
|
||||||
|
{ "n", "<leader>gCX", actions.conflict_choose_all("none"), { desc = "Delete the conflict region for the whole file" } },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
opts = {
|
||||||
|
defaults = {
|
||||||
|
["<leader>gC"] = { name = "+conflicts" },
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
opts = {},
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,21 +4,22 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
default_mappings = false,
|
default_mappings = false,
|
||||||
},
|
},
|
||||||
|
version = "v1.0.0",
|
||||||
|
cmd = { "GitConflictChooseTheirs", "GitConflictChooseOurs", "GitConflictChooseBoth", "GitConflictListQf" },
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>gct", "<cmd>GitConflictChooseTheirs<cr>", desc = "Choose Their Changes" },
|
{ "<leader>gCt", "<cmd>GitConflictChooseTheirs<cr>", desc = "Choose Their Changes" },
|
||||||
{ "<leader>gco", "<cmd>GitConflictChooseOurs<cr>", desc = "Choose Our Changes" },
|
{ "<leader>gCo", "<cmd>GitConflictChooseOurs<cr>", desc = "Choose Our Changes" },
|
||||||
{ "<leader>gcb", "<cmd>GitConflictChooseBoth<cr>", desc = "Choose Both changes" },
|
{ "<leader>gCb", "<cmd>GitConflictChooseBoth<cr>", desc = "Choose Both changes" },
|
||||||
{ "<leader>gcl", "<cmd>GitConflictListQf<cr>", desc = "Git Conflict Quicklist" },
|
{ "<leader>gCl", "<cmd>GitConflictListQf<cr>", desc = "Git Conflict Quicklist" },
|
||||||
{ "[g", "<cmd>GitConflictPrevConflict<cr>", desc = "Prev Git Conflict" },
|
{ "[g", "<cmd>GitConflictPrevConflict<cr>", desc = "Prev Git Conflict" },
|
||||||
{ "]g", "<cmd>GitConflictPrevConflict<cr>", desc = "Next Git Conflict" },
|
{ "]g", "<cmd>GitConflictPrevConflict<cr>", desc = "Next Git Conflict" },
|
||||||
},
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
defaults = {
|
defaults = {
|
||||||
["<leader>gc"] = { name = "+conflicts" },
|
["<leader>gC"] = { name = "+conflicts" },
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue