feat(git): :Gedit, path/stage completion, status.statusline()

This commit is contained in:
2026-04-30 18:13:49 +02:00
parent 1c91753500
commit af7e187aa9
4 changed files with 102 additions and 8 deletions
+10 -4
View File
@@ -13,10 +13,6 @@ local HIGHLIGHTS = {
local M = {}
function M.status()
return vim.b.git_status or ""
end
function M.init()
for name, link in pairs(HIGHLIGHTS) do
vim.api.nvim_set_hl(0, name, { link = link, default = true })
@@ -103,6 +99,16 @@ function M.init()
complete = complete_rev,
desc = "Diff against <rev> (horizontal split)",
})
vim.api.nvim_create_user_command("Gedit", function(opts)
vim.cmd.edit({
args = { "git://" .. opts.args },
magic = { file = false },
})
end, {
nargs = 1,
complete = complete_rev,
desc = "Edit a git object (<rev>)",
})
vim.api.nvim_create_user_command("G", function(opts)
require("git.cmd").run(opts.fargs)