Created
July 13, 2012 10:39
Revisions
-
dansimau revised this gist
Jul 13, 2012 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,15 +2,13 @@ ## Mac OS X 1. Install `colordiff` using Homebrew: brew install colordiff 2. Add function to your `~/.bash_profile`: cat <<EOF >>~/.bash_profile function diff { colordiff -u "$@" | less -RF @@ -27,7 +25,7 @@ Copy and paste these give easy commands: 4. Reload: . ~/.bash_profile @@ -39,4 +37,4 @@ Copy and paste these give easy commands: * `-u` in `diff` means: unified diff * `-R` in `less` means: show raw escape codes (so we can see the colour) * `-F` in `less` means: quit if entire output fits on one screen -
dansimau created this gist
Jul 13, 2012 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ # Enable git-style colour output in regular diff ## Mac OS X Copy and paste these give easy commands: 1. Install `colordiff` using Homebrew: brew install colordiff 2. Add function to your `~/.bash_profile`: cat <<EOF >~/.bash_profile function diff { colordiff -u "$@" | less -RF } EOF 3. Change default output colours to match git: cat <<EOF >~/.colordiffrc newtext=green oldtext=red diffstuff=cyan EOF 4. Reload: . ~/.bash_profile 5. Profit. --- *Notes on switches:* * `-u` in `diff` means: unified diff * `-R` in `less` means: show raw escape codes (so we can see the colour) * `-F` in `less` means: quit if entire output fits on one screen