Simplest Neovim inline diff view with character-level highlighting.
This plugin is solely focused on providing a better inline Git diff view. It is meant to be used alongside your favorite Git plugin (for example, gitsigns). I created inlinediff-nvim because gitsigns lacked character-level highlighting and its inline decorations could disappear on cursor move.
inspiration: mini.diff, gitsigns
-- lazy.nvim
return {
"YouSame2/inlinediff-nvim",
lazy = true, -- disable loading plugin until called with cmd or keys
cmd = "InlineDiff",
opts = {}, -- leave blank to use defaults
keys = {
{
"<leader>ghp",
function()
require("inlinediff").toggle()
end,
desc = "Toggle inline diff",
},
},
opts = {
debounce_time = 200,
ignored_buftype = { "terminal", "nofile" },
ignored_filetype = { "TelescopePrompt", "NvimTree", "neo-tree" },
colors = {
-- context = dim background color; change = bright background color for changed text.
InlineDiffAddContext = "#182400",
InlineDiffAddChange = "#395200",
InlineDiffDeleteContext = "#240004",
InlineDiffDeleteChange = "#520005",
},
}
:InlineDiff toggle:InlineDiff refresh