From 3d6580f52b7867009ee22390636a0d24e4609038 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 4 Mar 2022 09:36:05 +0100 Subject: [PATCH] home: vim: centralise 'git'-related mappings --- home/vim/after/plugin/mappings/git.vim | 18 ------------------ home/vim/plugin/settings/gitsigns.vim | 3 +++ 2 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 home/vim/after/plugin/mappings/git.vim diff --git a/home/vim/after/plugin/mappings/git.vim b/home/vim/after/plugin/mappings/git.vim deleted file mode 100644 index bb8b194..0000000 --- a/home/vim/after/plugin/mappings/git.vim +++ /dev/null @@ -1,18 +0,0 @@ -lua << EOF -local wk = require("which-key") - -local keys = { - d = { - name = "Merging diff hunks", - o = { "diffget", "Use this buffer's change", mode="x" }, - p = { "diffput", "Accept other buffer change", mode="x" }, - }, - ["g"] = { - name = "Git", - l = { ":spT:Gllog --follow -- %:p", "Current buffer log" }, - m = { "(git-messenger)", "Current line blame" }, - }, -} - -wk.register(keys) -EOF diff --git a/home/vim/plugin/settings/gitsigns.vim b/home/vim/plugin/settings/gitsigns.vim index 7804f3e..c8f11a1 100644 --- a/home/vim/plugin/settings/gitsigns.vim +++ b/home/vim/plugin/settings/gitsigns.vim @@ -26,7 +26,10 @@ gitsigns.setup({ b = { gitsigns.toggle_current_line_blame, "Toggle blame virtual text" }, d = { gitsigns.diffthis, "Diff buffer" }, D = { function() gitsigns.diffthis("~") end, "Diff buffer against last commit" }, + g = { "Git", "Git status" }, h = { gitsigns.toggle_deleted, "Show deleted hunks" }, + L = { ":spT:Gllog --follow -- %:p", "Current buffer log" }, + m = { "(git-messenger)", "Current line blame" }, p = { gitsigns.preview_hunk, "Preview hunk" }, r = { gitsigns.reset_hunk, "Revert hunk" }, R = { gitsigns.reset_buffer, "Revert buffer" },