diffview.nvim icon indicating copy to clipboard operation
diffview.nvim copied to clipboard

[feature] option for unified- / inline-diff

Open cd-a opened this issue 4 years ago • 9 comments

I love this plugin, so thank you very much for your work.

One thing I'm missing though is the ability to use inline-diffs, instead of side by side.

For lots of minor changes, I find it's a lot easier to read.

Sth like this: Screenshot 2021-07-08 at 09 12 37

Is this anything that is planned?

cd-a avatar Jul 08 '21 07:07 cd-a

It is not planned, no. And honestly, I don't see a good reason to implement it in this plugin, seeing as there are many great tools for doing this already. I highly recommend checking out delta if you haven't already.

Using delta or simliar you can easily set up some custom commands for showing inline diffs:

" Open inline diff for changes in all files in a vertical split
command! DiffInline vsp | exe 'term git diff | delta' | startinsert

" Open inline diff for changes in current file in a vertical split
command! DiffInlineFile vsp | exe 'term git diff -- '
            \ . shellescape(expand("%")) . ' | delta' | startinsert

Running these commands looks something like this:

image

Also, all git wrappers for vim that I can think of support inline diffs. That includes Fugitive and Neogit.

I'll keep this up for consideration. I might implement something like this at some point, but it's not a priority.

sindrets avatar Jul 08 '21 19:07 sindrets

Thanks for responding, and the recommendations! Appreciate it

cd-a avatar Jul 09 '21 05:07 cd-a

BTW, diffchar.vim is one option for this case.

linsong avatar Jun 17 '22 08:06 linsong

Thanks for this great plugin.

I would really appreciate if diffview had this feature. I run most of my git commands in the terminal, but (re)viewing diffs is just much easier with diffview. It wouldn't make sense to install a git integration like neogit solely for the unified diff view, when diffview already is my diff viewing tool.

Would you deem this feature request out of scope, or would you consider it if there were enough demand and/or a PR adding this feature?

damrath avatar Apr 10 '24 12:04 damrath