Skip to content

Instantly share code, notes, and snippets.

@marklit
Created October 31, 2011 16:46
Show Gist options
  • Save marklit/1327968 to your computer and use it in GitHub Desktop.
Save marklit/1327968 to your computer and use it in GitHub Desktop.
Diff syntax highlighting
hg diff | \
sed -e 's/^--- .*/'`echo -e "\033[0;46m"`'&'`echo -e "\033[0m"`'/' | \
sed -e 's/^+++ .*/'`echo -e "\033[0;46m"`'&'`echo -e "\033[0m"`'/' | \
sed -e 's/^-.*/'`echo -e "\033[0;41m"`'&'`echo -e "\033[0m"`'/' | \
sed -e 's/^+.*/'`echo -e "\033[0;42m"`'&'`echo -e "\033[0m"`'/' | \
less -R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment