home: vim: git: more visual mappings

I cannot use the functions directly, as I would need to calculate the
current selections begin and end points and use them as arguments.

To be investigated.
This commit is contained in:
Bruno BELANYI 2022-03-04 16:29:54 +01:00
parent 57e5def998
commit 3df2ad0f1f

View file

@ -47,6 +47,15 @@ gitsigns.setup({
local visual = { local visual = {
["ih"] = { gitsigns.select_hunk, "Git hunk" }, ["ih"] = { gitsigns.select_hunk, "Git hunk" },
-- Only the actual command can make use of the visual selection...
["<leader>g"] = {
name = "Git",
p = { ":Gitsigns preview_hunk<CR>", "Preview selection" },
r = { ":Gitsigns reset_hunk<CR>", "Restore selection" },
s = { ":Gitsigns stage_hunk<CR>", "Stage selection" },
u = { ":Gitsigns undo_stage_hunk<CR>", "Undo stage selection" },
},
} }
wk.register(keys, { buffer = bufnr }) wk.register(keys, { buffer = bufnr })