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 |
---@type LazySpec[]
return {
{
"lewis6991/gitsigns.nvim",
event = "BufRead",
keys = function()
local g = require "gitsigns"
return {
{ "]g", g.next_hunk },
{ "[g", g.prev_hunk },
{ "<leader>gs", g.stage_hunk },
{ "<leader>gS", g.undo_stage_hunk },
{ "<leader>gr", g.reset_hunk },
{ "<leader>gh", g.preview_hunk },
}
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 } },
---@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 },
},
},
}
|