Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] option for unified- / inline-diff #39

Open
cd-a opened this issue Jul 8, 2021 · 4 comments · May be fixed by #267
Open

[feature] option for unified- / inline-diff #39

cd-a opened this issue Jul 8, 2021 · 4 comments · May be fixed by #267
Labels
enhancement New feature or request

Comments

@cd-a
Copy link

cd-a commented Jul 8, 2021

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?

@sindrets
Copy link
Owner

sindrets commented Jul 8, 2021

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 sindrets added the enhancement New feature or request label Jul 8, 2021
@cd-a
Copy link
Author

cd-a commented Jul 9, 2021

Thanks for responding, and the recommendations! Appreciate it

@linsong
Copy link

linsong commented Jun 17, 2022

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

@damrath
Copy link

damrath commented Apr 10, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants