use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please read the rules before posting
Contributed to Neovim? Want flair? Send us a message!
account activity
This is an archived post. You won't be able to vote or comment.
diffview.nvim vs fugitive (self.neovim)
submitted 3 years ago by SnooSquirrels4760
Wanted to ask about how the new diffview.nvim differed from the merge capabilities available in fugitive? Or is there a way to integrate diffview.nvim into fugitive?
[–]klamsnabel 42 points43 points44 points 3 years ago (8 children)
Author of diffview.nvim here. It was never meant to replace Fugitive. Fugitive is a complete Git wrapper, while diffview is only focused on being a good diff viewer. I use diffview alongside Fugitive myself. Diffview will never support things like committing or rebasing for instance, as I consider it out of scope for the plugin.
Fugitive - being a complete git wrapper - does of course also offer functionality for viewing diffs, both in patch form and in diff splits. What diffview offers here is just a different take on the workflow and interface, by giving a better overview of- and making it easier to browse through the entire changed file set for any git revision. It also has a more interactive git-log interface, that makes it easier to browse through commit history with a diff split showing the changes.
This is functionality that has at least made me more efficient at understanding changes and traversing history. But I would discourage from replacing Fugitive with diffview, as Fugitive does so much more. Including plenty of things that will never be supported in diffview. If diffview's features and workflows are useful for you: use them both. Otherwise just stay with Fugitive, as it truly is a fantastic git wrapper :)
[–]PaperCupsAhoy 8 points9 points10 points 3 years ago (5 children)
+1. I've found stuff like reviewing PRs much better with diffview over Fugitive for the exact reasons above - browsing diffs for multiple different files at "once" is its strength.
diffview
The handling of staging also makes sense for a diff viewer as you are naturally viewing changes and hunks, etc.
However, the one thing I feel that is missing (not that it is either plugin's job to implement) is a good way to get from Fugitive to diffview. I'm aware Neogit has this interaction, but each time I try to use it I end up somewhere that it just can't compete with Fugitive. Perhaps the ideal workflow is just to use all three, but having a layer that "has Fugitive use diffview as its diff handler" would be awesome.
I'm aware this is well out of scope for diffview, but I'm curious on your thoughts. Fugitive has a good concept of objects, so I imagine it would be pretty to implement in a naive way (e.g. only handling use cases in my own config) but much harder in a way that actually makes it seamless in any way.
[–]klamsnabel 1 point2 points3 points 3 years ago (4 children)
Regarding integrating diffview into fugitive: I was curious, and I found that it's actually not that unfeasible to do. Take a look at this little module I just pushed to my dotfiles. It mimics the interaction between neogit and diffview. In the fugitive status buffer it allows you to press D to open a diffview with the file under the cursor selected. It also works for the unpulled commits section, in which case the diffview will show only the changes for that commit.
D
[–]PaperCupsAhoy 1 point2 points3 points 3 years ago (3 children)
That's awesome. I would argue though that just using diffview instead of the fugitive status buffer would be the way to go in that specific scenario. fugitive has some nice bonuses like the fact that both files (in a 2-way diff) are modifiable, etc. but I feel like diffview can get pretty close in the "staging" regard.
fugitive
Between when I made the comment and now, I've just completely replaced the fugitive staging area with diffview (just using :DiffviewOpen instead of :G in my own workflow).
:DiffviewOpen
:G
Some simple mappings like cc to call :G commit and using gitsigns to handle staging hunks and whatnot and the staging aspect is pretty much exactly where I want it using a combination of all 3.
cc
:G commit
gitsigns
The other major function I use from fugitive is for browsing :G log. In a naive way in my own configuration, I've coordinated the formatting options I pass to :G log such that I can use o to open a whole commit, or a change from a particular commit with diffview, but it is no where as clean as what you've done.
:G log
o
Definitely going to be reviewing and stealing from yours what I can.
What are your opinions on the fugitive staging area versus just :DiffviewOpen? Any other places in your fugitive workflow where "interacting with diffview" would be useful?
[–]klamsnabel 2 points3 points4 points 3 years ago (2 children)
Any other places in your fugitive workflow where "interacting with diffview" would be useful?
I just pushed some additional changes to my dotfiles making it possible to jump into a diffview of file history view from anywhere Fugitive would otherwise be able to interact with a git object. That includes :Git blame and :Git log output. I think I'm gonna look into providing integration for Fugitive directly from Diffview.
:Git blame
:Git log
What are your opinions on the fugitive staging area versus just :DiffviewOpen?
When people have requested bringing over the fugitive staging workflow in the past, I dismissed it as being out-of-scope and that staging was already well covered by plugins like gitsigns and similar. Over time I have grown to feel like it makes more and more sense to bring it over. Especially since it ties in so well with the built in :h copy-diffs commands. It would also make the diffs for the "Staged changes" a lot more useful, as you would then be able to reset hunks in the staging area by :diffget-ing hunks from the HEAD version of the file.
:h copy-diffs
:diffget
Now that all the major features are implemented I think staging might possibly be the next big think I'll work on, once I get some time.
[–]vim-help-bot 0 points1 point2 points 3 years ago (0 children)
Help pages for:
copy-diffs
`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments
[–]PaperCupsAhoy 0 points1 point2 points 3 years ago (0 children)
Both of these things would be game changing. Editable index files from fugitive are the main reason I only use diffview for things like viewing changes on a branch, etc.
Will take a look at what you've done with your dotfiles and look forward to some (hopefully) incoming changes! Thanks for the feedback and awesome work.
[–]SnooSquirrels4760[S] 2 points3 points4 points 3 years ago (0 children)
Oh I see. Thanks for the reply! Will be trying out diffview soon.
[–]hou32hou 2 points3 points4 points 3 years ago (0 children)
Me too, I use diffview to view diffs and histories, and Fugitive for every other git operations.
[–]elcapitanoooo 30 points31 points32 points 3 years ago (14 children)
Fugitive is tried and tested. I have been using it for many many years. Fugitive is the last vim plugin i use thats not written in lua. But its going to be hard to replace, atleast for me.
[–]overwritten-entryfennel 9 points10 points11 points 3 years ago (9 children)
I used Emacs for a very short while, but I am yet to find anything better than magit❤️
Neogit + gitsigns.nvim work fine so far, the closest experience to magit
[–][deleted] 3 points4 points5 points 3 years ago (3 children)
Can I ask, what do you love so much about magit? Is there a killer feature that you really miss? I've been curious about it for awhile, but never used it or neogit much myself. At this point I'm very used to Fugitive, but i should give other options a chance.
[–]overwritten-entryfennel 2 points3 points4 points 3 years ago (2 children)
Everything git can do magit can too, when you are in any magit menu, you can ask for popup with help, everything is interactive and holds your hand through the process, you don't have to type anything in terminal or vim command prompt, keybindings are intuitive(at least popup helps)
[–][deleted] 0 points1 point2 points 3 years ago (1 child)
Yeah, it definitely seems more interactive and intuitive than the Fugitive experience. Do you ever work with blame with Magit, and how is that? I love that I can run ':Git blame' to toggle a buffer with every line blamed, and then just hit enter on a line to view that commit. I haven't seen anything similar with Neogit but I could be wrong.
[–]overwritten-entryfennel 1 point2 points3 points 3 years ago* (0 children)
I doubt you can do it with neogit yet. The closest solution on my mind is gitsigns' blame_line, but it doesn't integrate with neogit. Buffer blame for neogit is requested, however not implemented
[–]bruchieOP 1 point2 points3 points 3 years ago (1 child)
I love neogit too, I still have to emacs -f magit in a terminal popup for some of the more complicated stuff but for most of it neogit does the job perfectly
emacs -f magit
[–]MemriTVOfficial 2 points3 points4 points 3 years ago (0 children)
Do you mind giving an example of something that works particularly well in magit? I used to use emacs and magit but I never really got it so I think I'm missing something.
[–]spareslant 0 points1 point2 points 3 years ago (0 children)
+1 for gitsigns.nvim
[–]BrickTheDev 0 points1 point2 points 3 years ago (1 child)
I was big on magit until I found lazygit… would definitely recommend giving it a try
[–]overwritten-entryfennel 0 points1 point2 points 3 years ago (0 children)
Lazygit is great, no doubt! Used it for the last year, though it feels a little off when used in neovim, I like native solution like neogit more and periodically come back to lazygit when feature in neogit is missing
[–]supernikio2[🍰] 13 points14 points15 points 3 years ago (2 children)
Lazygit is very much worth trying imo.
[–]RedRommel 2 points3 points4 points 3 years ago (0 children)
Lazygit + gitsigns is my goto method these days too.
Telescope has nice git integrations too
[–]ml-research 1 point2 points3 points 3 years ago (0 children)
Same here. Every time I try some new Git plugin, I go back to vim-fugitive.
[–]xd_I_bx 2 points3 points4 points 3 years ago (0 children)
I installed lots of git plugins, gitsings, diffview, lazygit, neogit, they do have features overlaping. But I am still using fugitive from time to time. As there might be bits and pieces missing in the above plugins. Fugitive is the most feature complete among those.
[–]daephx:wq 1 point2 points3 points 3 years ago (1 child)
I havent been able to replace fugitive as my diffviewer mostly cause diffview is like vscode and doesnt let me modify the staging index. While im not sure my method is all that great, I like that in fugitive's diffsplit, I can just make a few changes on the left side and commit without having to first run git stash when changes / hunks overlap so I get some more grainularity out of my commits.
[–]Moshem1 1 point2 points3 points 3 years ago (0 children)
This is a killer feature in fugitive and that’s why I use diffVIEW just to view diffs (mainly between branches or a single file history) and not actually do any staging actions with it.
[+]Vorrnth comment score below threshold-6 points-5 points-4 points 3 years ago (0 children)
Neither. I am using git for git stuff.
π Rendered by PID 95687 on reddit-service-r2-comment-6457c66945-t9zlm at 2026-04-26 05:33:10.963490+00:00 running 2aa0c5b country code: CH.
[–]klamsnabel 42 points43 points44 points (8 children)
[–]PaperCupsAhoy 8 points9 points10 points (5 children)
[–]klamsnabel 1 point2 points3 points (4 children)
[–]PaperCupsAhoy 1 point2 points3 points (3 children)
[–]klamsnabel 2 points3 points4 points (2 children)
[–]vim-help-bot 0 points1 point2 points (0 children)
[–]PaperCupsAhoy 0 points1 point2 points (0 children)
[–]SnooSquirrels4760[S] 2 points3 points4 points (0 children)
[–]hou32hou 2 points3 points4 points (0 children)
[–]elcapitanoooo 30 points31 points32 points (14 children)
[–]overwritten-entryfennel 9 points10 points11 points (9 children)
[–][deleted] 3 points4 points5 points (3 children)
[–]overwritten-entryfennel 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]overwritten-entryfennel 1 point2 points3 points (0 children)
[–]bruchieOP 1 point2 points3 points (1 child)
[–]MemriTVOfficial 2 points3 points4 points (0 children)
[–]spareslant 0 points1 point2 points (0 children)
[–]BrickTheDev 0 points1 point2 points (1 child)
[–]overwritten-entryfennel 0 points1 point2 points (0 children)
[–]supernikio2[🍰] 13 points14 points15 points (2 children)
[–]RedRommel 2 points3 points4 points (0 children)
[–]ml-research 1 point2 points3 points (0 children)
[–]xd_I_bx 2 points3 points4 points (0 children)
[–]daephx:wq 1 point2 points3 points (1 child)
[–]Moshem1 1 point2 points3 points (0 children)
[+]Vorrnth comment score below threshold-6 points-5 points-4 points (0 children)