Not the prettiest necessarily, but you could could do it with process substitution and heredocs:
diff <(cat <<EOF1
First text
and more
EOF1) <(cat <<EOF2
Second text
and more
EOF2)
would produce the output:
1c1
< First text
---
> Second text
and you could put whatever you like in each block of text of course.
Another option would be to use vim
as in the answers here
The process I'd like with that one would be to do the following within vim
:
- insert text into current buffer
- run
:diffthis
to include that window in the diff
- run
:vnew
to get another window split vertically so they are side-by-side
- insert text from second source
- run
:diffthis
presto, you've got your highlighted diff