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

Directory Diffing

Open rgrinberg opened this issue 3 years ago • 5 comments

Would it be possible to view diffs using this plugin outside the context of VCS? In particular, I'd like to diff two directories and browse the diff using the diffview UI.

I'd like to replace my current use of https://github.com/will133/vim-dirdiff with this plugin

rgrinberg avatar Jan 15 '23 06:01 rgrinberg

We could potentially allow passing the --no-index flag to :DiffviewOpen which would solve this:

       git diff [<options>] --no-index [--] <path> <path>
           This form is to compare the given two paths on the filesystem. [...]

But I believe this would require a fair amount of refactoring, as a lot of the git adapter code requires a reference to a git repository.

I'll consider it in the future.

sindrets avatar Jan 15 '23 12:01 sindrets

Right, that would be pretty neat. It would also be pretty good to navigate a diff loaded from a patch file. It's not such a common workflow anymore, but I do run into patches from time to time.

Thanks for the great plugin!

rgrinberg avatar Jan 15 '23 16:01 rgrinberg

The patch file idea is interesting. Feel free to open an issue about it so that we can track it separately.

sindrets avatar Jan 18 '23 13:01 sindrets

This would be a fantastic change. I need to keep vim running just for dir-diff. (I can't use dir-diff with Neovim because it is confused by the folding https://github.com/will133/vim-dirdiff/issues/39.)

That said, if you do support dir-diffs, it would be great to somehow preserve the configuration files that guide linters and text editing, like: .editorconfig and pyproject.toml. Without these, linters are completely confused.

NeilGirdhar avatar Mar 28 '23 03:03 NeilGirdhar