This is an automated archive made by the Lemmit Bot.

The original was posted on /r/neovim by /u/bug-way on 2024-09-02 22:12:15+00:00.


Hey. Today at work I realised just how much I depend on diffview.nvim for writing code on a daily (even hourly) basis. I use it constantly.

Generally I work in feature branches on large codebases. I need to see an overview of what I’m writing and nothing else, since it’s usually just one area of the project I’m focused on and the rest is irrelevant. I’m constantly switching to my diff view to see my contribution and I often use this as a navigational tool as well, since it allows me to jump to the files I’ve been working on and more precisely to the areas of a file I’m working on.

For this I use gdd (diff view of working tree).

On top of that, I regularly need to jump onto someone else’s feature branch and see what they have contributed. I use diffview.nvim to compare their branch to main using :DiffviewOpen main..HEAD. This is extremely useful when I want to explore their PR deeper than looking at it in the browser (on GitHub or whatever).

For this I use gdm (diff view main).

In addition, I use diffview.nvim to review my own code before committing. The speciality of diffview.nvim comes into play when I need to make small adjustments, which I can do directly in the diff view window.

I pretty much always have a working tree diff view open in neovim. And I often have a main..HEAD diff view as well if I’m working on a long-life feature with many commits.

I also used this workflow heavily in VSC years ago, since the diff view behaves similarly on there.

So my question is, if you aren’t using diffview.nvim, I wonder what your workflow looks like and what tools you use to accomplish it. I anticipate that people might just stick with git diff maybe in conjunction with delta, but this does not allow for the perks of navigating and making adjustments inside the diff.

Cheers!