dotfiles

personal configuration files and scripts
git clone https://tongong.net/git/dotfiles.git
Log | Files | Refs | README

diffc (290B)


      1 #!/bin/sh -eu
      2 
      3 # Use diff-highlight to show word-level differences
      4 # https://stackoverflow.com/a/39865453
      5 diffhighlight="/usr/share/git/diff-highlight/diff-highlight"
      6 
      7 diff -U3 --minimal "$@" |
      8   sed 's/^-/\x1b[1;31m-/;s/^+/\x1b[1;32m+/;s/^@/\x1b[1;34m@/;s/$/\x1b[0m/' |
      9   "$diffhighlight"