feat(git): replace vim-fugitive with custom git module

This commit is contained in:
2026-04-27 12:41:38 +02:00
parent 5a3e39574d
commit f55d7ac11d
13 changed files with 837 additions and 145 deletions
-36
View File
@@ -1,36 +0,0 @@
vim.api.nvim_create_user_command("Glog", function(opts)
local mods = opts.mods ~= "" and (opts.mods .. " ") or ""
vim.cmd(
mods
.. "Git log --graph --all --decorate --date=short "
.. "--format=format:'%h %ad {%an}%d %s' "
.. opts.args
)
end, { nargs = "*", desc = "Pretty git log via fugitive" })
vim.keymap.set("n", "<leader>gl", vim.cmd.Glog)
vim.keymap.set("n", "<leader>gd", vim.cmd.Gvdiffsplit)
vim.keymap.set("n", "<leader>gD", function()
vim.cmd.Gvdiffsplit("HEAD")
end)
vim.keymap.set("n", "<leader>gh", vim.cmd.Ghdiffsplit)
vim.keymap.set("n", "<leader>gH", function()
vim.cmd.Ghdiffsplit("HEAD")
end)
vim.keymap.set("n", "<leader>gc", function()
vim.cmd.G("commit")
end)
vim.keymap.set("n", "<leader>ga", function()
vim.cmd.G("commit --amend")
end)
vim.keymap.set("n", "<leader>gp", function()
vim.cmd.G("push")
end)
vim.api.nvim_create_autocmd("User", {
pattern = "GitRefresh",
group = vim.api.nvim_create_augroup("ow.fugitive", { clear = true }),
callback = function()
vim.fn["fugitive#ReloadStatus"]()
end,
})