feat(git): :Gedit, path/stage completion, status.statusline()
This commit is contained in:
+10
-4
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user