2024-02-25 04:13:48 +01:00
|
|
|
local options = {
|
|
|
|
signs = {
|
|
|
|
add = { text = "│" },
|
|
|
|
change = { text = "│" },
|
|
|
|
delete = { text = "" },
|
|
|
|
topdelete = { text = "‾" },
|
|
|
|
changedelete = { text = "~" },
|
|
|
|
untracked = { text = "│" },
|
|
|
|
},
|
|
|
|
|
|
|
|
on_attach = function(bufnr)
|
|
|
|
local gs = package.loaded.gitsigns
|
|
|
|
|
|
|
|
local function opts(desc)
|
|
|
|
return { buffer = bufnr, desc = desc }
|
|
|
|
end
|
|
|
|
|
|
|
|
local map = vim.keymap.set
|
|
|
|
|
|
|
|
map("n", "<leader>rh", gs.reset_hunk, opts "Reset Hunk")
|
|
|
|
map("n", "<leader>ph", gs.preview_hunk, opts "Preview Hunk")
|
|
|
|
map("n", "<leader>gb", gs.blame_line, opts "Blame Line")
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
|
2024-02-29 17:33:20 +01:00
|
|
|
return {
|
|
|
|
"lewis6991/gitsigns.nvim",
|
|
|
|
event = "User FilePost",
|
|
|
|
opts = options,
|
2024-03-04 03:37:10 +01:00
|
|
|
|
2024-02-29 17:33:20 +01:00
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "git")
|
|
|
|
require("gitsigns").setup(opts)
|
|
|
|
end,
|
|
|
|
}
|