man y git things added
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
return {
|
||||
"AstroNvim/astrocommunity",
|
||||
{ import = "astrocommunity.colorscheme.github-nvim-theme" },
|
||||
{ import = "astrocommunity.git.neogit" },
|
||||
{ import = "astrocommunity.git.diffview-nvim" },
|
||||
{ import = "astrocommunity.markdown-and-latex.vimtex" },
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
return {
|
||||
{
|
||||
"AstroNvim/astrocore",
|
||||
opts = function(_, opts)
|
||||
local maps = opts.mappings
|
||||
maps.n = maps.n or {}
|
||||
maps.x = maps.x or {}
|
||||
|
||||
-- Keep <leader>g focused on repo UI, while hunk actions stay buffer-local in gitsigns.
|
||||
maps.n["<Leader>g"] = { desc = "Git" }
|
||||
|
||||
maps.n["<Leader>gg"] = false
|
||||
maps.n["<Leader>gb"] = false
|
||||
maps.n["<Leader>gc"] = false
|
||||
maps.n["<Leader>gC"] = false
|
||||
maps.n["<Leader>gt"] = false
|
||||
maps.n["<Leader>gT"] = false
|
||||
maps.n["<Leader>go"] = false
|
||||
maps.x["<Leader>go"] = false
|
||||
|
||||
maps.n["<Leader>gn"] = false
|
||||
maps.n["<Leader>gnt"] = false
|
||||
maps.n["<Leader>gnc"] = false
|
||||
maps.n["<Leader>gnd"] = false
|
||||
maps.n["<Leader>gnk"] = false
|
||||
maps.n["<Leader>gnf"] = false
|
||||
maps.n["<Leader>gnh"] = false
|
||||
maps.n["<Leader>gnv"] = false
|
||||
|
||||
end,
|
||||
},
|
||||
{
|
||||
"NeogitOrg/neogit",
|
||||
keys = {
|
||||
{ "<leader>gg", "<Cmd>Neogit<CR>", desc = "Git status" },
|
||||
{ "<leader>gb", "<Cmd>Neogit branch<CR>", desc = "Git branches" },
|
||||
{ "<leader>gc", "<Cmd>Neogit commit<CR>", desc = "Git commit" },
|
||||
{ "<leader>gs", "<Cmd>Neogit stash<CR>", desc = "Git stash" },
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.integrations = opts.integrations or {}
|
||||
opts.integrations.diffview = true
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
{
|
||||
"sindrets/diffview.nvim",
|
||||
cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewFileHistory" },
|
||||
keys = {
|
||||
{ "<leader>gd", "<Cmd>DiffviewOpen<CR>", desc = "Git diff" },
|
||||
{ "<leader>gD", "<Cmd>DiffviewClose<CR>", desc = "Git diff close" },
|
||||
{ "<leader>gh", "<Cmd>DiffviewFileHistory %<CR>", desc = "Git history (file)" },
|
||||
{ "<leader>gH", "<Cmd>DiffviewFileHistory<CR>", desc = "Git history (repo)" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = function(_, opts)
|
||||
-- Gitsigns owns only in-buffer hunk work, so its maps stay local and minimal.
|
||||
opts.on_attach = function(bufnr)
|
||||
local gitsigns = require "gitsigns"
|
||||
local map = function(lhs, rhs, desc)
|
||||
vim.keymap.set("n", lhs, rhs, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
map("<Leader>gl", gitsigns.blame_line, "View Git blame")
|
||||
map("<Leader>gp", gitsigns.preview_hunk, "Preview Git hunk")
|
||||
map("]h", function() gitsigns.nav_hunk "next" end, "Next Git hunk")
|
||||
map("[h", function() gitsigns.nav_hunk "prev" end, "Previous Git hunk")
|
||||
end
|
||||
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user