A Neovim plugin for displaying git diffs in a side-by-side floating window, similar to Gitsigns diffthis but with a more visual interface.
- GitHub-style side-by-side diff display in floating windows
- Soft-wrapped lines with aligned rows and a separate line-number gutter
- Full-width red/green backgrounds with bold, stronger highlights on the exact changed characters
- Synchronized scrolling between original and modified content
- Syntax highlighting for the current file type
- Easy to close with
q,<Esc>, or<C-c> - Toggle staging for the current hunk with
a - Current hunk state in the footer (staged, unstaged, or partial), without covering code
- Support for different diff targets (HEAD, staged, specific commits)
Using lazy.nvim:
{
'JoshuaFurman/diffy',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require('diffy').setup()
end
}Using packer.nvim:
use {
'JoshuaFurman/diffy',
requires = { 'nvim-lua/plenary.nvim' },
config = function()
require('diffy').setup()
end
}:Diffy- Show diff for current file against HEAD:Diffy staged- Show diff for staged changes:Diffy <commit>- Show diff for current file at specific commit
When the diff window is open:
q- Close the diff window<Esc>- Close the diff window<C-c>- Close the diff window<Enter>- Jump to the selected location in the source buffer and close the diff windown- Jump to the next hunkp- Jump to the previous hunka- Toggle staging for the current hunk
require('diffy').setup({
width = 0.8, -- Window width as fraction of screen
height = 0.8, -- Window height as fraction of screen
border = 'rounded', -- Border style
winblend = 0, -- Opaque panes for readable diff colors
wrap = true, -- Soft-wrap long lines; false restores horizontal scrolling
})Diffy provides light/dark defaults without changing Neovim's global Diff* groups.
Line backgrounds preserve syntax colors; exact changed characters also get bold text and a
stronger background. Override these groups in your colorscheme configuration (reapply overrides
on ColorScheme if you switch themes):
vim.api.nvim_set_hl(0, 'DiffyAdd', { bg = '#142b21' })
vim.api.nvim_set_hl(0, 'DiffyDelete', { bg = '#2b1b20' })
vim.api.nvim_set_hl(0, 'DiffyAddText', { bg = '#1f633b', bold = true })
vim.api.nvim_set_hl(0, 'DiffyDeleteText', { bg = '#7d2834', bold = true })
vim.api.nvim_set_hl(0, 'DiffyFiller', { bg = '#161b22' })nvim --clean --headless -c "luafile test.lua"To verify the actual rendered UI colors (including changed spaces and wrapped lines):
uv run --no-project --with pynvim python tests/screen.pyThis additional screen test uses pynvim only for testing, not as a plugin dependency.
- Neovim 0.10+ (wrapped-row measurement and smooth scrolling)
- Git
- plenary.nvim
- gitsigns.nvim - Git signs and hunk management