A tiny Neovim plugin that shows a simple, keyboard‑driven list of recent Git commits and lets you diff them quickly via Diffview.
Works great for: “show me the last N commits, let me pick one (or two) and open the diff”.
- Lists recent commits using
git log(configurablemax_count) - Toggle selection with space, navigate with
j/k - Press Enter to open diffs in [diffview.nvim]
- 1 selected commit → diff that commit against its parent (
<hash>^..<hash>) - 2 selected commits → diff between the two commits
- 1 selected commit → diff that commit against its parent (
- Neovim ≥ 0.10 (uses
vim.system) - Git available on your
$PATH - Dependencies:
{
"Salanoid/gitlogdiff.nvim",
main = "gitlogdiff",
dependencies = {
"sindrets/diffview.nvim",
"folke/snacks.nvim",
},
cmd = "GitLogDiff",
opts = { max_count = 300 },
}use({
"Salanoid/gitlogdiff.nvim",
requires = {
"sindrets/diffview.nvim",
"folke/snacks.nvim",
},
config = function()
require("gitlogdiff").setup({
max_count = 300,
})
end,
})Note: This plugin defines the :GitLogDiff command on load. If your plugin manager pre-defines lazy command stubs, gitlogdiff.nvim will safely overwrite them (we create the command with force = true).
- Run
:GitLogDiffinside a Git repository - Navigate with
j/k - Toggle selection with
<space> - Press
<CR>to open diffs in Diffview - Press
qto close the list
require("gitlogdiff").setup({
max_count = 300, -- how many commits to list
})- “No git commits found”: you are likely not in a Git repo (or
max_countis 0) - “git log failed …”: check that
gitis installed and available in$PATH
- Remove snacks as a dependency.
- Should work with other diff viwers plugins for example with: [esmuellert/codediff.nvim]: https://github.com/esmuellert/codediff.nvim
MIT — see LICENSE.
