feat(git): :Glog command, per-module setup, plugin/ auto-init

This commit is contained in:
2026-04-30 15:05:47 +02:00
parent 282ec2602d
commit 217390cfa4
9 changed files with 153 additions and 108 deletions
+27
View File
@@ -185,4 +185,31 @@ function M.split(opts)
place_pair(buf, cur_buf, true, opts.vertical)
end
function M.setup()
local function diff_split_cmd(vertical)
return function(opts)
M.split({
rev = opts.args ~= "" and opts.args or nil,
vertical = vertical,
})
end
end
vim.api.nvim_create_user_command(
"Gdiffsplit",
diff_split_cmd(true),
{ nargs = "?", desc = "Diff against <rev>" }
)
vim.api.nvim_create_user_command(
"Gvdiffsplit",
diff_split_cmd(true),
{ nargs = "?", desc = "Diff against <rev> (vertical split)" }
)
vim.api.nvim_create_user_command(
"Ghdiffsplit",
diff_split_cmd(false),
{ nargs = "?", desc = "Diff against <rev> (horizontal split)" }
)
end
return M