Files
dotfiles/dot_config/nvim/lua/plugins/git.lua
s0wlz (Matthias Puchstein) ca2b441bb7 nvim,tmux,kitty: full config overhaul (AstroNvim → native 0.12)
Replaces AstroNvim v5 with from-scratch Neovim 0.12 config using
vim.lsp.config()/vim.lsp.enable() natively, lazy.nvim, blink.cmp,
and smart-splits tmux integration.

tmux: new C-Space prefix, hjkl pane nav, resize key table, tpm plugins.
kitty: add allow_remote_control for smart-splits.
2026-04-09 23:30:34 +02:00

64 lines
1.8 KiB
Lua

return {
-- Gutter signs, hunk navigation, inline blame
{
"lewis6991/gitsigns.nvim",
event = { "BufReadPost", "BufNewFile" },
opts = {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
changedelete = { text = "" },
untracked = { text = "" },
},
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local map = function(mode, lhs, rhs, desc)
vim.keymap.set(mode, lhs, rhs, { buffer = bufnr, desc = desc })
end
-- Navigation
map("n", "]h", function()
if vim.wo.diff then return "]h" end
vim.schedule(function() gs.next_hunk() end)
return "<Ignore>"
end, "Next hunk")
map("n", "[h", function()
if vim.wo.diff then return "[h" end
vim.schedule(function() gs.prev_hunk() end)
return "<Ignore>"
end, "Prev hunk")
-- Actions
map("n", "<leader>hs", gs.stage_hunk, "Stage hunk")
map("n", "<leader>gu", gs.undo_stage_hunk, "Undo stage hunk")
map("n", "<leader>gh", gs.preview_hunk, "Preview hunk")
map("n", "<leader>hb", gs.toggle_current_line_blame, "Toggle blame")
map("n", "<leader>gb", gs.toggle_current_line_blame, "Toggle blame")
map("n", "<leader>gd", gs.diffthis, "Diff this")
end,
},
},
-- Magit-style full git interface
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",
"nvim-telescope/telescope.nvim",
},
cmd = "Neogit",
keys = {
{ "<leader>gg", "<cmd>Neogit<cr>", desc = "Neogit" },
},
opts = {
integrations = {
telescope = true,
diffview = true,
},
},
},
}