No description
Find a file
2026-02-09 19:45:17 -05:00
.github fix: remove useless ci script 2026-02-04 15:39:27 -05:00
doc fix: pre-release cleanup for v0.2.0 (#102) 2026-02-09 15:08:36 -05:00
lua/diffs fix(highlight): support combined diff format for unmerged files (#106) 2026-02-09 19:30:13 -05:00
plugin feat: unified diff conflict resolution for unmerged files (#99) 2026-02-09 12:21:13 -05:00
spec fix(highlight): support combined diff format for unmerged files (#106) 2026-02-09 19:30:13 -05:00
.busted feat(test): testing infrastructure 2026-02-01 23:09:05 -05:00
.editorconfig feat: initial setup files 2026-02-01 16:30:24 -05:00
.gitignore feat: initial setup files 2026-02-01 16:30:24 -05:00
.luarc.json fix(ci): add jit to luarc globals for lua-language-server 2026-02-06 13:58:30 -05:00
.pre-commit-config.yaml fix: use yaml, not yml YAML file extension 2026-02-02 22:14:04 -05:00
.prettierignore feat: initial setup files 2026-02-01 16:30:24 -05:00
.prettierrc fix: use yaml, not yml YAML file extension 2026-02-02 22:14:04 -05:00
diffs.nvim-scm-1.rockspec feat: rename everything 2026-02-02 22:09:13 -05:00
LICENSE feat: initial setup files 2026-02-01 16:30:24 -05:00
README.md Update README.md 2026-02-09 19:45:17 -05:00
selene.toml feat: initial setup files 2026-02-01 16:30:24 -05:00
stylua.toml feat: initial setup files 2026-02-01 16:30:24 -05:00
vim.toml cleanup 2026-02-02 14:06:58 -05:00

diffs.nvim

Syntax highlighting for diffs in Neovim

Enhance vim-fugitive and Neovim's built-in diff mode with language-aware syntax highlighting.

Features

  • Treesitter syntax highlighting in fugitive diffs and commit views
  • Character-level intra-line diff highlighting (with optional vscode-diff FFI backend for word-level accuracy)
  • :Gdiff unified diff against any revision
  • Background-only diff colors for &diff buffers
  • Inline merge conflict detection, highlighting, and resolution
  • Vim syntax fallback, configurable blend/debounce/priorities

Requirements

  • Neovim 0.9.0+

Installation

Install with your package manager of choice or via luarocks:

luarocks install diffs.nvim

Documentation

:help diffs.nvim

Known Limitations

  • Incomplete syntax context: Treesitter parses each diff hunk in isolation. Context lines within the hunk ( prefix) provide syntactic context for the parser. In rare cases, hunks that start or end mid-expression may produce imperfect highlights due to treesitter error recovery.

  • Syntax flashing: diffs.nvim hooks into the FileType fugitive event triggered by vim-fugitive, at which point the buffer is preliminarily painted. The buffer is then re-painted after debounce_ms milliseconds, causing an unavoidable visual "flash" even when debounce_ms = 0.

  • Conflicting diff plugins: diffs.nvim may not interact well with other plugins that modify diff highlighting. Known plugins that may conflict:

    • diffview.nvim - provides its own diff highlighting and conflict resolution UI
    • mini.diff - visualizes buffer differences with its own highlighting system
    • gitsigns.nvim - generally compatible, but both plugins modifying line highlights may produce unexpected results
    • git-conflict.nvim - diffs.nvim now includes built-in conflict resolution; disable one or the other to avoid overlap

Acknowledgements