6 ms·
Not for a side-by-side diff, but I just use this for color diffs: cdiff() { diff -u "$@" \ | sed 's/^\(@@ .* @@\)$/'$'\e[36m''\1'$'\e[m''/g'
by chjj 12y ago
Not for a side-by-side diff, but I just use this for color diffs:
cdiff() {
diff -u "$@" \
| sed 's/^\(@@ .* @@\)$/'$'\e[36m''\1'$'\e[m''/g' \
| sed 's/^\(-.*\)$/'$'\e[31m''\1'$'\e[m''/g' \
| sed 's/^\(+.*\)$/'$'\e[32m''\1'$'\e[m''/g' \
| less -c -R
}
- cbr 12y agoYour cdiff colors lines by whether they're added or removed: http://www.jefftk.com/cdiff-shell-function-2x.png http://www.jefftk.com/cdiff-shell-function-2x.png icdiff colors just the part of the line that changed: http://www.jefftk.com/icdiff-comparison-1234a1234.png http://www.jefftk.com/icdiff-comparison-1234a1234.png