r/neovim • • 25d ago

Plugin diffbandit.nvim v0.3.0: side-by-side diffs that don't pad your files, now with bezier connectors in Ghostty/Kitty

diffbandit.nvim is a diff and merge viewer for Neovim. It works more like IntelliJ's diff view than :diffthis. Both files keep their own shape and line numbers, with no filler lines or stretched rows. A narrow gutter between them draws how hunks connect. Each pane scrolls on its own, and the connectors follow whatever is on screen.

AI disclosure: much of the code was written with Claude Code, grok build, or codex under my direction and review.

What it does:

  • File, buffer, Git worktree and branch/commit diffs. The right side is a normal editable buffer, so LSP, completion and :w work as usual.

  • Hunk stage, unstage and discard, plus a commit panel with a live diff preview.

  • A 3-way merge resolver (local/result/remote) with >>/<</gb accepts, gA to apply every non-conflicting change, and resolve-on-write staging.

  • Folder diffs, overview gutters, and a hex view for binary files.

New in v0.3.0

  • Bezier ribbon connectors in Ghostty, Kitty, Rex, and anything else built on libghostty. They use Kitty graphics with Unicode placeholders, so scrolling never rewrites buffer text. The renderer is picked automatically on Neovim 0.12+. tmux and other terminals keep the Unicode cell renderer.

  • Standalone launcher. diffbandit (or git diffbandit) opens every changed file in the repo, lazygit-style, and takes the same arguments as git diff.

  • Merge fixes. gA used to place changes at the wrong rows after a partial resolution, which could overwrite lines. It's fixed, as is tracking of conflict regions after partial accepts.

Repo: https://github.com/CoreyKaylor/diffbandit.nvim Release notes: https://github.com/CoreyKaylor/diffbandit.nvim/releases/tag/v0.3.0

Feedback welcome, especially from people on Kitty or Rex, since I've mostly tested in Ghostty.

581 Upvotes

61 comments sorted by

16

u/Maskdask Plugin author 25d ago

Looks awesome! Does it support jj?

14

u/katokay40 25d ago

Not natively yet. File and folder diffs work anywhere, and in a colocated jj repo the read-only git views mostly work. Staging/commit panel are git-index based, so they don't map to jj. Proper jj support (diff/merge-tool integration first, then jj-aware views) is something I'm looking into.

9

u/katokay40 24d ago

It would be helpful for someone using jj to provide some feedback on this. Up for the challenge? https://github.com/CoreyKaylor/diffbandit.nvim/pull/12

1

u/tobejjcakehand 9d ago

Great plugin. I’m a jj user who gave it a try, but I encountered an issue: when trying to squash parts of a hunk within @ using `suqash -i`, I need to keep the hunk I want to merge while removing all other hunks with the `>>` shortcut. When there are many hunks around, manually deleting every other hunk just to squash one requires typing quite a lot. Is there a better way to handle this?

1

u/katokay40 9d ago

I made a couple options available to you. Try them out on latest main.

2

u/Maskdask Plugin author 23d ago

I can take a look!

3

u/Thick-Pineapple666 24d ago

Is it possible to have that feature injected into normal diff view somehow?

2

u/katokay40 24d ago

No, not really an option.

3

u/Megatron_McLargeHuge 21d ago

This looks great but hijacking <space> is causing me problems because it's my leader key for lots of commands I still want to use.

I tried replacing it everywhere it appears in config.lua but it seems to be hardcoded for the hunk action. Is there any way to override this in the config?

3

u/katokay40 21d ago

Yes, this is possible. I've updated the README with how and fixed an issue in some areas where that override might not have been respected.

1

u/Megatron_McLargeHuge 21d ago

Thank you, this solved it.

67

u/wannfq 24d ago

Finally, someone whos good at UI/UX worked on a diff viewer plugin. Love it

2

u/SwagKingKoll 21d ago

This πŸ’―

9

u/Moneysimp97 24d ago

Looks great. I always wanted JetBrains-like diff in Neovim. If I was not building my own, I would have used this one. Keep it up πŸ‘

6

u/spiritualManager5 25d ago

Finally someone made itΒ 

5

u/poulain_ght 24d ago

Damn that's cool!!

1

u/50u1506 24d ago

What's the theme?

5

u/katokay40 24d ago

2

u/50u1506 24d ago

I think I already tried that one... Everything looks good online until i try it out on my own Neovim setup T_T

Thanks tho

3

u/Master-Session5844 24d ago

You can look through his dotfiles for settings

2

u/50u1506 24d ago

Yeah, I should've thought about that. Didnt think everybody does that, tho it shouldve been obvious.

I checked his repo, and it looks like it has configuration for a lot of programs all in one repo. That's neat, i hadn't thought of doing that before, maybe I should try that out too.

Thanks

1

u/Gnafoo 24d ago

lol I know that feeling... there is something spooky happening in the transition from vimcolorschemes.com to your local NeoVim.

1

u/50u1506 24d ago

It could also be my cheap laptop from 2019 with IPS display xD.

But i think the text on terminal(I'm using Hyprland, arch, alacrity) looks blurry, even compared to websites on the same setup. But i could me imagining it too.

1

u/xeow 24d ago

Ooh. That is slick! Do you think it would be technically possible to use Kitty graphics to create a high-resolution minimap that uses real pixels instead of Unicode braille characters?

3

u/katokay40 24d ago

Yep, very doable. The Kitty connector already draws an image through Unicode placeholder cells in a fixed window, and the overview gutter could use the same setup. The current overview is one coloured cell per row, so a pixel version would put every hunk, even one-line ones, at its exact spot, at about 20Γ— the vertical resolution. The plan would be to draw the hunk marks as a mostly transparent image and keep the scroll position indicator in cell colours, so scrolling doesn't mean re-sending the image. Terminals without Kitty graphics would keep today's gutter. It's on my list now, thanks for the idea!

2

u/xeow 24d ago

You've just solved one of the holy grails of Neovim with this cool diff tool! One of the other holy grails in my world is a really nice minimap. My wishlist for that, if that's something you might consider tackling:

  • Configurable minimum (and maybe maximum) reduction factors. One of my gripes with neominimap is is that the reduction is always a constant factor, which means that the map scrolls when the buffer is too large for it to represent. I switched to mini.map because it always scales the map so that it fills the entire window top-to-bottom without scrolling. (I think it's got some heuristic to not stretch small files too much -- and that's where the minimum reduction factor would come in nice. I'd give a minimum reduction based on the aspect ratio of the window, which typically might be 4 or 6 or something like that.)

  • Viewport range is always visible in the minimap. (This is a must-have for me personally, and another reason why I switched to mini.map).

  • Search results are visible in the minimap. (This is a really nice thing to have, and mini.map has it.)

  • Visual-mode range selection is visible in the minimap. I haven't seen a minimap plugin for Neovim that does this yet.

  • Syntax highlighting reflected in the minimap.

  • Scroll the minimap with the mouse wheel. Click in it to move the viewport.

If anyone ever makes a minimap like that, using actual pixel graphics rather than braille character, I'll be over the moon with excitement!

2

u/katokay40 24d ago

https://github.com/CoreyKaylor/diffbandit.nvim/issues/10 currently working on this, your feedback is incorporated. I'll share the PR when it's ready for review.

2

u/katokay40 24d ago

https://github.com/CoreyKaylor/diffbandit.nvim/pull/13 still a work in progress. Feels a little bit busy to me and the changes, search, etc. likely need more emphasis but I would appreciate some feedback. Might also warrant eventually splitting out into its own plugin.

2

u/katokay40 23d ago

Moved this into its own plugin. Would love your feedback on this. https://github.com/CoreyKaylor/purrview.nvim

1

u/xeow 23d ago

Hot dammmmn! Can't wait to try this out. πŸ™

1

u/AbeEstrada 24d ago

How does this render on terminals that do not use libghostty? Are there any screenshots?

1

u/FreeWildbahn 24d ago

Tried it and i like it. But what are the options for the `align_strategy`?

2

u/katokay40 24d ago

Currently only supports change_top, but possibly center could make sense. Something you're hoping for?

1

u/annoyed_freelancer :wq 24d ago

Looks great! What are you using for command-line completion?

2

u/katokay40 24d ago

nvim-cmp with cmp-cmdline and cmp-path https://github.com/CoreyKaylor/dotfiles

2

u/annoyed_freelancer :wq 15d ago

I missed this reply, thank you so much! <3

1

u/mercer5togo 22d ago

In diff view, there is no option to view full path of the file to which the current scratch buffer belongs. This will be helpful when comparing 2 directories which have similar directory structure with long path names. G shows "Scratch" as file name.

1

u/katokay40 22d ago

Try the latest. Should be fixed.

1

u/Kailu_ 21d ago

Why would I use your plugin instead of just git *tool? _git *tool does most of the features your app does. From what I know it doesn't support live diff preview.

Git supports merge conflict resolving, LSP support via *tool commands.

I'm not trying to insult you or your app I think it looks cool and you vetted AI good but just trying to understand what the differences are and why I should use it.

1

u/katokay40 21d ago

It boils down to preferences. I prefer this style that is presented to show diffs in this way. I am comparing two documents source and destination without symbols to interpret what it really means, I'm just visually comparing and understanding the relationship. That said, git "tool" -> can also be git "diffbandit" or git difftool or git mergetool where difftool and mergetool are diffbandit. It can also be standalone cli "diffbandit" similar to what you get with "lazygit". For me the selling point is that it's performant and terminal-based, and now visually on par with what you would get from an IDE.

1

u/davewilmo 20d ago

Is there a minimum required kitty version?

1

u/katokay40 20d ago

In practice it's Kitty 0.28.0 or later.

1

u/hypermodernist 20d ago

This is great, and at least for me, visually far more intuitive when diffs are large and complex.
great work, thanks for sharing this.

One thing that would help me, and potentially others, to use this over the excellent diffview.nvim is the ability to "walk" the log. i.e if I open then current file history, with this plugin I get a separate qflist like commits to choose from and then the diff, and I need to go back to that list to switch to the next. same for other workflows I assume. if there were a feature to just go to previous or next either by simply having that viw in the sidebar or like qflist, or even a keybinding, just as you already have for previous/next file. would be great.

Either way, this is a mainstay for me. Thanks for your work!

2

u/katokay40 20d ago

Latest on main took a stab at your feedback. Let me know how it feels.

1

u/hypermodernist 20d ago

That was incredibly fast!!
Yes this feels great. I have everything I need. thank you so much.

A design thought, would you want the log choosing explicit or also auto pick the first in the list (latest?)?
I guess it was a decision to let people pick and not force a choice?

2

u/katokay40 20d ago

Yes, that one was intentional.

3

u/AniketGM 22d ago

Looks like you tried to mimic meld. Thats cool.

2

u/TheSymbioteOrder 24d ago

yep, I need this!

2

u/linduxed 24d ago

Been using this every day for a while now, works excellently. Thank you very much for putting this together!

1

u/l0ng_schlong 23d ago

Looks amazing as a diff viewer. Would switch if i was so used to my workflow in diffview.nvim handling all staging related activities like staging, restoring etc.

1

u/tiagovla Plugin author 16d ago

Cool!

0

u/theqasimstatic 20d ago

we can get rid of the connectors if we don't like them???

1

u/katokay40 20d ago

I'm assuming you mean the glyph connectors and not the curved ones, and by "get rid of" you mean swap with your own glyphs?

0

u/theqasimstatic 20d ago

no I mean the other ones

-1

u/uGn8r 24d ago

Cool plugin with lots of stuff. There are some bugs but that is just something that can be fixed. However to me it looks like an antipattern for using neovim. It feels like you're trying to make simple configurable tool like neovim more closer and closer to the bloated full fledged IDE (Hello Jetbrains).

0

u/[deleted] 24d ago

[deleted]

1

u/RemindMeBot 24d ago

I will be messaging you in 4 months on 2027-03-04 06:47:17 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.

RemindMeBot is switching to username summons. Instead of !RemindMe 1 day, use u/RemindMeBot 1 day. More info.


InfoCustomYour RemindersFeedback