✨ feat(nvim): new extra: gitgraph.nvim
This commit is contained in:
parent
b3b22f14aa
commit
fea0775cab
1 changed files with 40 additions and 0 deletions
40
.config/nvim/lua/plugins/extras/editor/git/gitgraph.lua
Normal file
40
.config/nvim/lua/plugins/extras/editor/git/gitgraph.lua
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
return {
|
||||||
|
"isakbm/gitgraph.nvim",
|
||||||
|
opts = {
|
||||||
|
symbols = {
|
||||||
|
merge_commit = "",
|
||||||
|
commit = "",
|
||||||
|
},
|
||||||
|
format = {
|
||||||
|
timestamp = "%H:%M:%S %d-%m-%Y",
|
||||||
|
fields = { "hash", "timestamp", "author", "branch_name", "tag" },
|
||||||
|
},
|
||||||
|
hooks = {
|
||||||
|
on_select_commit = function(commit)
|
||||||
|
if LazyVim.has("diffview.nvim") then
|
||||||
|
vim.notify("DiffviewOpen " .. commit.hash .. "^!")
|
||||||
|
vim.cmd(":DiffviewOpen " .. commit.hash .. "^!")
|
||||||
|
else
|
||||||
|
print("selected commit:", commit.hash)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
on_select_range_commit = function(from, to)
|
||||||
|
if LazyVim.has("diffview.nvim") then
|
||||||
|
vim.notify("DiffviewOpen " .. from.hash .. "~1.." .. to.hash)
|
||||||
|
vim.cmd(":DiffviewOpen " .. from.hash .. "~1.." .. to.hash)
|
||||||
|
else
|
||||||
|
print("selected range:", from.hash, to.hash)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>gl",
|
||||||
|
function()
|
||||||
|
require("gitgraph").draw({}, { all = true, max_count = 5000 })
|
||||||
|
end,
|
||||||
|
desc = "Graph",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue