Settings

Theme

Show HN: Unified.nvim – A Neovim plugin for inline Git diffs

github.com

3 points by axkdev 8 months ago · 0 comments · 1 min read

Reader

Hi HN,

I was looking for a way to view diff in a unified/github style in neovim and didn't find any satisfying solution. There are a couple of plugins that partially address like vgit.nvim, but all of them lacked some of the things I need, so I built unified.nvim.

The functionality is very basic. You just call :Unified command with a commit reference as first argument (for ex. HEAD). A tree window opens on the left listing all of the changed files and navigating the tree opens that file automatically in a buffer. It's just a normal buffer with highlights + virtual lines. You can modify it and the diff will update accordingly, also your normal LSP go to definition etc. will work, similarly to diffview. In fact I took a lot of inspiration (but no code) from diffview and it's UI. The reason why this woulld not work as a feature in diffview, is because diffview relies on build in neovim diffing.

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection