diff --git a/lua/astrocommunity/git/gitgraph-nvim/README.md b/lua/astrocommunity/git/gitgraph-nvim/README.md new file mode 100644 index 000000000..b9093628e --- /dev/null +++ b/lua/astrocommunity/git/gitgraph-nvim/README.md @@ -0,0 +1,5 @@ +# gitgraph.nvim + +Git Graph plugin for neovim + +**Repository** diff --git a/lua/astrocommunity/git/gitgraph-nvim/init.lua b/lua/astrocommunity/git/gitgraph-nvim/init.lua new file mode 100644 index 000000000..295dc16d9 --- /dev/null +++ b/lua/astrocommunity/git/gitgraph-nvim/init.lua @@ -0,0 +1,35 @@ +return { + "isakbm/gitgraph.nvim", + lazy = true, + opts = {}, + specs = { + { -- mapping to open GitGraph + "AstroNvim/astrocore", + opts = { + mappings = { + n = { + ["g|"] = { + function() require("gitgraph").draw({}, { all = true, max_count = 5000 }) end, + desc = "GitGraph", + }, + }, + }, + }, + }, + { -- use diffview for viewing commits if available + "sindrets/diffview.nvim", + optional = true, + specs = { + { + "isakbm/gitgraph.nvim", + opts = { + hooks = { + on_select_commit = function(commit) vim.cmd.DiffviewOpen(commit.hash .. "^!") end, + on_select_range_commit = function(from, to) vim.cmd.DiffviewOpen(from.hash .. "~1.." .. to.hash) end, + }, + }, + }, + }, + }, + }, +}