Hacker News new | past | comments | ask | show | jobs | submit login

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
    }



Your cdiff colors lines by whether they're added or removed: 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: