Show HN: difi – A Git diff TUI with Neovim integration (written in Go)

38 points - today at 1:47 PM

Source

Comments

nesk_ today at 2:57 PM
One recommendation to help this tool gain traction: use a black and white terminal for your terminal preview (GIF).

1. It will ease reading. It's currently terrible, you might be used to it but we aren't.

2. It will sharpen the text and make it easier to read since there's less to encode into the GIF format.

Additional recommendations: remove the useless part on the right—I use Arch BTW vibe—and make the font bigger.

freedomben today at 3:20 PM
Looks like a neat tool, and one I really need! I actually started building my own because I couldn't find anything satisfying. My build is currently in the very early stages and I'd love to abandon it :-) I'm definitely going to try difi out.

Also kudos for putting up a screenshot. I've looked through a lot of projects claiming to do similar to this, but there are so many different interpretations that can make it not a good fit for me, and when there aren't any screenshots the barrier of seeing it in action is often too high to where I only try one or two before I give up and stop wasting time. Having a screenshot made it so I could check it out quickly.

The screenshot is a little rough, so a few tips for next time:

1. Shrink your terminal window down a bit as a huge view is harder to follow

2. Keep the screenshots at full resolution so they are easier to read. The reduced resolution and the original screen being huge makes the text pretty difficult to read, even zoomed in to 200%

3. Use something like screenkey (or throw some subtitle text up or something) so the viewer knows what keys you are pressing and/or what you're trying do. It's pretty hard to follow along without those cues.

Great work, and thanks for sharing!

verdverm today at 5:17 PM
https://github.com/jesseduffield/lazygit

Full featured, also written in go, if that sort of thing matters to you

xyzzy_plugh today at 4:19 PM
For vim heads also worth checking out tpope's fugitive:

https://github.com/tpope/vim-fugitive

Very useful for inspecting and staging changes, making commits, etc.

I find you can pretty much do anything with it, and it's much faster than anything else, but it does have a slight learning curve. The documentation is very good!

oug-t today at 1:49 PM
Personally speaking the git diff command is great for output, but can be improved for reviewing.

With difi the TUI made for git diff it allows to me speed up the review process and make it more enjoyable.

For the nvim integration, there already exists diffview and code diff, but I still favors the github website's solution of highlighting + and - inside one file rather then side by side.

difi: https://github.com/oug-t/difi difi.nvim: https://github.com/oug-t/difi.nvim

vhantz today at 3:51 PM
In the readme there are only commands explicitly running the tool. Can it be set as the diff tool for git? If not, you should look into that. It will help adoption. And if yes, you should make it clear in the docs.
kolja005 today at 4:38 PM
Hey pretty cool! I recently added a similar feature to my neovim setup. I can press a keymap and cycle through all of the unstaged git hunks with each shown in a preview window. I can also change the base branch to one that, say, I'm trying to merge into so that I can have the same workflow when doing code reviews.
manescianera today at 5:03 PM
Looks neat! Any chance to integrate delta with it?

https://github.com/dandavison/delta

theappsecguy today at 4:34 PM
Would love if this was something capable of doing PR reviews with comment threads, etc! Super tired of having to open up Intellij to get the only usable option for that kind of flow
LysPJ today at 5:21 PM
Looks nice! Any chance of a side-by-side mode?
lasgawe today at 5:30 PM
This looks really cool. I need to try it. Previously I used Sublime Merge for diff issues.
oug-t today at 3:35 PM
Curious to hear thoughts on editor support, do you guys feel specific integrations (Emacs/Vim) are necessary for tool like this, or the TUI work flow is enough?

Now it mainly supports `nvim`.

pure-orange today at 5:20 PM
very nice, lovely tui. Does it support viewing the diff of unstaged files? I tend to do a lot of commit amending locally so would be nice if I could see the status of these before I amend the commit
yearolinuxdsktp today at 2:45 PM
Reminds me of `tig`, which is a TUI with a continuous diff (not side by side) viewer… you can revert chunks inline. Has tree view, diff view and blame view.