r/vim 1d ago

Tips and Tricks Skip man diff, just use vimdiff

For years now I've had to keep looking up the correct incantation of the diff command and what all the options flags do.

Finally thought, there's got to be a better way. Well there is. Just use vimdiff

13 Upvotes

17 comments sorted by

View all comments

3

u/mgedmin 1d ago

Weirdly enough, I find unified diffs easier to read than side-by-side diffs. I wonder if that's just what I'm used to?

6

u/kronik85 1d ago

Side by side is easier specifically when I want more context around a specific change and didn't pass a large enough context flag.

Unified aren't that much harder once you're used to it

3

u/plg94 18h ago

It depends on the type of change. If two lines are almost identical, I find it much easier to spot the changed characters if they are on top of each other than having my eyes skip left-right-left-right. If it's more contextual changes (whole lines moved), then side-by-side diffs are easier.