home: vim: centralise 'git'-related mappings

This commit is contained in:
Bruno BELANYI 2022-03-04 09:36:05 +01:00
parent 03e412b2f0
commit b6435f0d57
2 changed files with 3 additions and 18 deletions

View file

@ -1,18 +0,0 @@
lua << EOF
local wk = require("which-key")
local keys = {
d = {
name = "Merging diff hunks",
o = { "<cmd>diffget<CR>", "Use this buffer's change", mode="x" },
p = { "<cmd>diffput<CR>", "Accept other buffer change", mode="x" },
},
["<leader>g"] = {
name = "Git",
l = { "<cmd>:sp<CR><C-w>T:Gllog --follow -- %:p<CR>", "Current buffer log" },
m = { "<Plug>(git-messenger)", "Current line blame" },
},
}
wk.register(keys)
EOF

View file

@ -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 = { "<cmd>Git<CR>", "Git status" },
h = { gitsigns.toggle_deleted, "Show deleted hunks" },
L = { "<cmd>:sp<CR><C-w>T:Gllog --follow -- %:p<CR>", "Current buffer log" },
m = { "<Plug>(git-messenger)", "Current line blame" },
p = { gitsigns.preview_hunk, "Preview hunk" },
r = { gitsigns.reset_hunk, "Revert hunk" },
R = { gitsigns.reset_buffer, "Revert buffer" },