When I use diff -y
to compare two text files with long lines of text, the result cuts off each column and I cannot read an entire line. I would like instead the text to wrap (or fold as it is also called) so that I can read the whole line.
For example, say I have two simple text files one line each:
cat tmp.txt tmp2.txt
The quick brown fox jumped over the lazy dog. This line is very long and will not show when I use a diff.
The quick brown fox did not jump over the lazy dog. This line is very long and will not show when I use a diff.
diff
ing them I get,
diff -y tmp.txt tmp2.txt
The quick brown fox jumped over the lazy dog. This line is ve | The quick brown fox did not jump over the lazy dog. This line
which cuts off the lines in the middle.
I know about the -W
option to make it wider, but the lines are longer than my screen width so this does not help. Using a simple diff
does make the text wrap, but there is no text wrapping with diff -y
.
So how can I use diff -y
with text wrapping?
I'm using the terminal on a Mac, if that helps.
This seems like a simple thing to want, but after searching everywhere I cannot find a solution!