Skip to content

Instantly share code, notes, and snippets.

@GregKWhite
Last active July 15, 2021 00:53
Show Gist options
  • Save GregKWhite/dbf710ddf72cfae502ad695019a87a1c to your computer and use it in GitHub Desktop.
Save GregKWhite/dbf710ddf72cfae502ad695019a87a1c to your computer and use it in GitHub Desktop.
Describes how to set up diff-so-fancy
  • Install diff-so-fancy via their website (or just run npm install -g diff-so-fancy)
  • Add the following to your .gitconfig file:
[core]
  pager = diff-so-fancy | less --tabs=1,5 -R
  • I find that these colors work best with it, but it's up to you if you want to add them to your .gitconfig or not.
[color "diff"]
  meta = "yellow bold"
  commit = "green bold"
  frag = "magenta bold"
  old = "red bold"
  new = "green bold"
  whitespace = "red reverse"
[color "diff-highlight"]
  oldNormal = "red bold"
  oldHighlight = "red bold 52"
  newNormal = "green bold"
  newHighlight = "green bold 22"
@MurphysChaos
Copy link

Those are colors for ANSI 256 (the 8-bit color version of ANSI escape codes). 22 is a dark green and 52 is a dark red. If you're curious, you can learn more here:

https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment