Git Graph plugin for neovim.
NOTE: this project is still very WIP and there is no help documentation aside from this README.md.
Note that this is still very early days and things may rapidly change in the beginning
{
'isakbm/gitgraph.nvim',
opts = {
git_cmd = "git",
symbols = {
merge_commit = 'M',
commit = '*',
},
format = {
timestamp = '%H:%M:%S %d-%m-%Y',
fields = { 'hash', 'timestamp', 'author', 'branch_name', 'tag' },
},
hooks = {
on_select_commit = function(commit)
print('selected commit:', commit.hash)
end,
on_select_range_commit = function(from, to)
print('selected range:', from.hash, to.hash)
end,
},
},
keys = {
{
"<leader>gl",
function()
require('gitgraph').draw({}, { all = true, max_count = 5000 })
end,
desc = "GitGraph - Draw",
},
},
},
When in the git graph buffer you can open Diffview on the commit under the cursor with Enter.
When in visual mode you get the Diffview for the selected range.
{
'isakbm/gitgraph.nvim',
dependencies = { 'sindrets/diffview.nvim' },
---@type I.GGConfig
opts = {
hooks = {
-- Check diff of a commit
on_select_commit = function(commit)
vim.notify('DiffviewOpen ' .. commit.hash .. '^!')
vim.cmd(':DiffviewOpen ' .. commit.hash .. '^!')
end,
-- Check diff from commit a -> commit b
on_select_range_commit = function(from, to)
vim.notify('DiffviewOpen ' .. from.hash .. '~1..' .. to.hash)
vim.cmd(':DiffviewOpen ' .. from.hash .. '~1..' .. to.hash)
end,
},
},
},
For example, use kitty branch symbols more detail
symbols = {
merge_commit = '',
commit = '',
merge_commit_end = '',
commit_end = '',
-- Advanced symbols
GVER = '',
GHOR = '',
GCLD = '',
GCRD = '╭',
GCLU = '',
GCRU = '',
GLRU = '',
GLRD = '',
GLUD = '',
GRUD = '',
GFORKU = '',
GFORKD = '',
GRUDCD = '',
GRUDCU = '',
GLUDCD = '',
GLUDCU = '',
GLRDCL = '',
GLRDCR = '',
GLRUCL = '',
GLRUCR = '',
},
... more keymaps to come ...
Lua
100.0%
Git Graph plugin for neovim.
NOTE: this project is still very WIP and there is no help documentation aside from this README.md.
Note that this is still very early days and things may rapidly change in the beginning
{
'isakbm/gitgraph.nvim',
opts = {
git_cmd = "git",
symbols = {
merge_commit = 'M',
commit = '*',
},
format = {
timestamp = '%H:%M:%S %d-%m-%Y',
fields = { 'hash', 'timestamp', 'author', 'branch_name', 'tag' },
},
hooks = {
on_select_commit = function(commit)
print('selected commit:', commit.hash)
end,
on_select_range_commit = function(from, to)
print('selected range:', from.hash, to.hash)
end,
},
},
keys = {
{
"<leader>gl",
function()
require('gitgraph').draw({}, { all = true, max_count = 5000 })
end,
desc = "GitGraph - Draw",
},
},
},
When in the git graph buffer you can open Diffview on the commit under the cursor with Enter.
When in visual mode you get the Diffview for the selected range.
{
'isakbm/gitgraph.nvim',
dependencies = { 'sindrets/diffview.nvim' },
---@type I.GGConfig
opts = {
hooks = {
-- Check diff of a commit
on_select_commit = function(commit)
vim.notify('DiffviewOpen ' .. commit.hash .. '^!')
vim.cmd(':DiffviewOpen ' .. commit.hash .. '^!')
end,
-- Check diff from commit a -> commit b
on_select_range_commit = function(from, to)
vim.notify('DiffviewOpen ' .. from.hash .. '~1..' .. to.hash)
vim.cmd(':DiffviewOpen ' .. from.hash .. '~1..' .. to.hash)
end,
},
},
},
For example, use kitty branch symbols more detail
symbols = {
merge_commit = '',
commit = '',
merge_commit_end = '',
commit_end = '',
-- Advanced symbols
GVER = '',
GHOR = '',
GCLD = '',
GCRD = '╭',
GCLU = '',
GCRU = '',
GLRU = '',
GLRD = '',
GLUD = '',
GRUD = '',
GFORKU = '',
GFORKD = '',
GRUDCD = '',
GRUDCU = '',
GLUDCD = '',
GLUDCU = '',
GLRDCL = '',
GLRDCR = '',
GLRUCL = '',
GLRUCR = '',
},
... more keymaps to come ...
Lua
100.0%