This will open two files in diff mode. You can then use a whole host of fancy keybindings to edit the two files in a diff-aware way ("apply this hunk to that file" / manually edit a file and then re-render the diff / "fold or expand all non-hunk text" / etc.). For more:
A similar tool that I really like is meld (https://meldmerge.org/). It has a GUI, really nice visual indicators, allows you to view the entire file and directory trees and you can jump between diff chunks using alt + arrow up/down.
How is that similar? It's a GUI. There's a zillion GUI diff tools but very few console ones. icdiff is the only side by side CLI diff tools I have seen.
It doesn't have side-by-side diffs, but it's still well worth having around.
It's a Unix filter, so it works on any unified diff you can come up with.
Its default output isn't a unified diff, but that's easy to fix with its configuration / CLI options (I'm too used to reading unified diffs to like delta's simplified default format).
I think, for changes within a line, wdiff would be the usual tool - but even if it's possible to pipe that through colordiff - I don't think there's a side-by-side mode for wdiff.
But yeah, I see that in-line highlighting of changes can be helpful sometimes :)
I've been using `alias diff=colordiff` for maybe twenty years. Looks like icdiff can highlight small changes without needing to call out the whole line. Is there anything else new this one brings?
At least one of the other tools in this thread does both.
(Rather than visualising add/rm with the foreground, it's visualised with the background colour).
https://github.com/dandavison/delta
Yes, but delta doesn't have side-by-side diff. Is someone aware of a command line util, that has side-by-side diff and syntax highlighting? I know that Gitlab can do that.
True, but vimdiff is a wrapper around vim, that starts the editor with pre-arranged windows. I would like to have a non-interactive stand-alone tool, that prints the syntax highlighted side-by-side to the terminal then exits and does not require you to learn vim. Maybe such a thing does not exist yet and I have to wait for delta issue #86 to happen.
Agree with this point. If your diff is so large you need syntax highlighting to make sense of it maybe you should step back and evaluate your version control habits. A diff tool should focus on what changed and nothing else.
I use CLion (or other Jetbrains IDEs, eg PyCharms on the occasions I'm not working in C/C++/Rust). They've got a very nice built-in 3-way merge diff tool. Non-free for some of the IDEs, but if you're working with a language that has a free "community edition" this is viable. Or if you're willing to pay for a very nice IDE.
I’ll get shot down for it, but I love the JetBrains IDE visual merge tool. It’s not free, but this among other things makes it worth it for professional work.