Skip to content

Instantly share code, notes, and snippets.

@pawelz
Created March 24, 2010 18:56
Show Gist options
  • Save pawelz/342642 to your computer and use it in GitHub Desktop.
Save pawelz/342642 to your computer and use it in GitHub Desktop.
diffcol() {
sed -e '
s,^[,^[[44m^[^[[49m,g;
s,^G,^[[44m^G^[[49m,g;
s,^\(Index:\|diff\|---\|+++\) .*$,^[[32m&,;
s,^@@ ,^[[33m&,;
s,^-,^[[35m&,;
s,^+,^[[36m&,;
s,\r,^[[44m^M^[[49m,g;
s, , ,g;
s,\([^[:space:]]\)\([[:space:]]\+\)$,\1^[[41m\2^[[49m,g;
s,$,^[[0m,
' ${1:+"$@"}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment