I fear that this answer will not satisfy you, but I think that you pose conflicting constraints.
About diff
But first I have to defend the classical diff tool: Its main purpose is to generate software patches that are supposed to be processed by machines on application. In addition, these patches are designed to be as compact as possible and to ideally use only ASCII characters, so that they can be shared fast and reliably via e-mail, Usenet, etc.
That these patches can be read by humans (and understood by some humans) is also an important property, but not top priority.
Your question
I fully understand and share your desire for simple and elementary command line tools, but a side by side diff, possibly with color highlighting, is neither simple nor does it lie within the scope what we can expect from a real command line tool, simply because it is not line orientated any more.
What comes next to it are Vi or Emacs based tools, which are as simple and clear for human reception as it can be, being highly flexible at the same time. They also offer powerful merging capabilities.
Form those, vimdiff
was already mentioned in the comments.
Concerning Emacs, file comparisons are typically started from within the editor. The most commonly used tool for that is Ediff, which offers umpteen entry points that correspond to the various needs: comparison of two files, tree files, one of them treated as a common ancestor, and so on. The same with possible merges.
Albeit unusual, I rigged up an access to Ediff from the command line: If you start Emacs with
emacs FILE1 FILE2 -nw --eval "(apply 'ediff-buffers (last (nreverse (buffer-list)) 2))"
then you jump directly in an interactive Ediff session that compares FILE1
and FILE2
within your terminal. If you omit the -nw
option (and all requirements are met), you get the same session in a separate graphical frame. See also this related question by ashutosh jain.
Okay, I would not go so far to call Emacs an easy tool. But if you study it thoroughly for some years, you will love it. (Personal opinion.)
So, unfortunately no: I do not know any tool that meets all of your constraints.
vimdiff
does exactly what you want (except for your constraint on not depending on vim.) I guess alternative tools do not exist since there are already tools (based on the editors) that do the job well. (They're not as user friendly asmeld
, but usually the crowd sticking to the terminal will prefer power over user friendliness, therefore build their tools on Vim!) – filbranden Feb 5 '19 at 15:30--unified
option makes the diff output much more readable. – wurtel Feb 5 '19 at 15:34