feat(nvim): add keybinds for gitsigns
This commit is contained in:
parent
5c2cb5feb4
commit
e949f942de
1 changed files with 21 additions and 0 deletions
|
@ -1 +1,22 @@
|
|||
require("gitsigns").setup()
|
||||
require("which-key").register({
|
||||
["["] = {
|
||||
h = { "<cmd>Gitsigns prev_hunk<cr>", "Previous hunk" },
|
||||
},
|
||||
["]"] = {
|
||||
h = { "<cmd>Gitsigns next_hunk<cr>", "Next hunk" },
|
||||
},
|
||||
})
|
||||
require("which-key").register({
|
||||
h = {
|
||||
name = "hunk",
|
||||
s = { "<cmd>Gitsigns stage_hunk<cr>", "Stage hunk", mode = { "n", "v" } },
|
||||
r = { "<cmd>Gitsigns reset_hunk<cr>", "Reset hunk", mode = { "n", "v" } },
|
||||
S = { "<cmd>Gitsigns stage_buffer<cr>", "Stage buffer" },
|
||||
R = { "<cmd>Gitsigns reset_buffer<cr>", "Reset buffer" },
|
||||
u = { "<cmd>Gitsigns undo_stage_hunk<cr>", "Undo stage hunk" },
|
||||
},
|
||||
}, { prefix = "<leader>g" })
|
||||
require("which-key").register({
|
||||
h = { ":<C-U>Gitsigns select_hunk<cr>", "Gitsigns select hunk" },
|
||||
}, { prefix = "i", mode = { "o", "x" } })
|
||||
|
|
Loading…
Reference in a new issue