init.lua/lua/plugins/git.lua(view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
---@type LazySpec
return {
{
"lewis6991/gitsigns.nvim",
event = "BufRead",
keys = function()
local function wrap(fn)
return function()
return require("gitsigns")[fn]()
end
end
return {
{ "]g", wrap "next_hunk" },
{ "[g", wrap "prev_hunk" },
{ "<leader>gs", wrap "stage_hunk" },
{ "<leader>gS", wrap "undo_stage_hunk" },
{ "<leader>gr", wrap "reset_hunk" },
{ "<leader>gh", wrap "preview_hunk" },
{ "<leader>gb", wrap "blame" },
}
end,
opts = {
max_file_length = 1000,
current_line_blame = true,
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
changedelete = { text = "" },
untracked = { text = "" },
},
current_line_blame_opts = {
virt_text_pos = "eol",
delay = 300,
},
},
},
{
"TimUntersberger/neogit",
cmd = "Neogit",
keys = { { "<leader>gg", vim.cmd.Neogit } },
---@module "neogit"
---@type NeogitConfig
opts = {
kind = "vsplit",
disable_builtin_notifications = true,
disable_commit_confirmation = true,
disable_context_highlighting = true,
disable_hint = true,
signs = {
section = { "", "" },
item = { "", "" },
hunk = { "", "" },
},
commit_editor = { kind = "split", staged_diff_split_kind = "split_above" },
integrations = { telescope = true },
},
},
}
|