dotfiles/modules/programs/nvim/plugins/gitsigns-nvim.lua

16 lines
795 B
Lua
Raw Normal View History

require("gitsigns").setup()
2023-04-09 19:27:34 +02:00
require("which-key").register({
2023-08-16 16:41:12 +02:00
["[h"] = { "<cmd>Gitsigns prev_hunk<cr>", "Previous hunk" },
["]h"] = { "<cmd>Gitsigns next_hunk<cr>", "Next hunk" },
["<leader>g"] = {
2023-04-09 19:27:34 +02:00
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" },
2023-08-16 16:41:12 +02:00
p = { "<cmd>Gitsigns preview_hunk_inline<cr>", "Preview hunk (inline)" },
P = { "<cmd>Gitsigns preview_hunk<cr>", "Preview hunk (float)" },
2023-04-09 19:27:34 +02:00
},
2023-08-16 16:41:12 +02:00
["ih"] = { ":<C-U>Gitsigns select_hunk<cr>", "gitsigns hunk", mode = { "o", "x" } },
})