init.lua/after/plugin/gitsigns.lua

22 lines
557 B
Lua
Raw Normal View History

2023-12-24 12:06:23 +01:00
require("gitsigns").setup({
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
changedelete = { text = "" },
untracked = { text = "" },
},
on_attach = function(buffer)
local gs = package.loaded.gitsigns
2023-12-24 12:06:23 +01:00
local function map(mode, l, r, desc)
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
end
2023-12-24 12:06:23 +01:00
-- stylua: ignore start
map("n", "]g", gs.next_hunk, "Next git hunk")
map("n", "[g", gs.prev_hunk, "Previous git hunk")
end,
2023-12-24 12:06:23 +01:00
})