sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.74k stars 105 forks source link

How can I create a feature like linediff.vim using difffview's UI? #328

Closed yutkat closed 1 year ago

yutkat commented 1 year ago

I am thinking of using diffview's cool UI to implement a linediff.vim feature.

Specifically, I want to compare two buffers and input them into diffview's UI.

Do you have any advice?

sindrets commented 1 year ago

Thank you for taking an interest in the project!

Can you explain how our UI would be useful here? The plugin you linked seems like it solves its own problem quite well (diffing and performing edits on two line ranges). What would be done differently in diffview.nvim?

yutkat commented 1 year ago

Thanks for your reply.

Specifically, I would want an interface that allows me to compare two buffers. Any file to the adapter, not just the VCS. https://github.com/sindrets/diffview.nvim/blob/052521c8948491c20f4e9278864ff058c6bb7436/lua/diffview/lib.lua#LL29-L34C5

sindrets commented 1 year ago

You can diff the current buffer against another one with:

:diffsplit {filename}

If you wanna compare more than two buffers, you can simply open the buffers you wanna compare and then :diffthis. When you're done diffing, do :diffoff!.

yutkat commented 1 year ago

That is true. but I just wanted to unify the diff UI into diffview.

I understand it's not easy to do, so I'd like to close this issue for now.

yutkat commented 1 year ago

I found that this plugin can do what I want. https://github.com/antosha417/nvim-compare-with-clipboard