require("gitsigns").setup { max_file_length = 1000, current_line_blame = true, current_line_blame_opts = { virt_text_pos = "eol", delay = 300, }, on_attach = function(bufnr) local g = package.loaded.gitsigns local map = function(from, to) vim.keymap.set("n", from, to, { buffer = bufnr, noremap = true, silent = true, }) end map("]g", g.next_hunk) map("[g", g.prev_hunk) map("gs", g.stage_hunk) map("gu", g.undo_stage_hunk) map("gr", g.reset_hunk) map("gp", g.preview_hunk) map("gb", g.blame_line) map("gd", g.diffthis) end, }