require("gitsigns").setup({ signs = { add = { text = "│" }, change = { text = "│" }, delete = { text = "󰦺" }, topdelete = { text = "󰦺" }, changedelete = { text = "│" }, untracked = { text = "┆" }, }, preview_config = { border = "rounded", }, on_attach = function(bufnr) local gs = package.loaded.gitsigns local function map(mode, l, r, opts) opts = opts or {} opts.buffer = bufnr vim.keymap.set(mode, l, r, opts) end map({ "n", "v" }, "hs", ":Gitsigns stage_hunk") map({ "n", "v" }, "hr", ":Gitsigns reset_hunk") map("n", "hp", gs.preview_hunk) map("n", "hR", gs.reset_buffer) map("n", "hd", gs.diffthis) map("n", "hj", gs.next_hunk) map("n", "hk", gs.prev_hunk) end, })