Skip to content

Commit

Permalink
feat(git): add gitgraph.nvim (#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter authored Aug 12, 2024
1 parent 1e93b21 commit 21251ca
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/astrocommunity/git/gitgraph-nvim/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# gitgraph.nvim

Git Graph plugin for neovim

**Repository** <https://github.com/isakbm/gitgraph.nvim>
35 changes: 35 additions & 0 deletions lua/astrocommunity/git/gitgraph-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
return {
"isakbm/gitgraph.nvim",
lazy = true,
opts = {},
specs = {
{ -- mapping to open GitGraph
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["<Leader>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,
},
},
},
},
},
},
}

0 comments on commit 21251ca

Please sign in to comment.