From 593f39fff3a822f1ab268791e4ef4a47bc714438 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 29 Mar 2018 15:57:51 +0100 Subject: [PATCH] git/config: improve git-diff colours with diff-so-fancy --- .config/git/config | 29 ++++++++++++++++++++++++----- .config/termite/config | 4 ++-- .profile | 2 +- aliases | 12 +++++------- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/.config/git/config b/.config/git/config index d4ee07a..94bf786 100644 --- a/.config/git/config +++ b/.config/git/config @@ -4,7 +4,8 @@ signingkey = CFBB6A86 [core] autocrlf = input - excludesfile = /home/frebib/.config/git/gitignore + excludesfile = $HOME/.config/git/gitignore + pager = diff-so-fancy | less [commit] gpgsign = true [push] @@ -13,8 +14,6 @@ rebase = true [rebase] autoStash = true -[color] - ui = auto [log] date = relative [format] @@ -27,8 +26,6 @@ [advice] statusHints = false pushUpdateRejected = false -[diff] - algorithm = patience [sendemail] from = Joe Groocock smtpserver = smtp.zoho.com @@ -36,3 +33,25 @@ smtpencryption = ssl smtpserverport = 465 suppresscc = self +[diff] + algorithm = patience +[interactive] + diffFilter = diff-so-fancy --patch-mode +[color] + ui = true +[color "diff"] + meta = cyan + frag = magenta + commit = yellow + old = red + new = green + whitespace = red 88 reverse +[color "diff-highlight"] + oldNormal = red + oldHighlight = red 88 + newNormal = green + newHighlight = green 22 +[diff-so-fancy] + changeHunkIndicators = false + +# vim: noet diff --git a/.config/termite/config b/.config/termite/config index 24de1ed..19f2e23 100644 --- a/.config/termite/config +++ b/.config/termite/config @@ -22,7 +22,7 @@ highlight = #5294E2 # Normal colours color0 = #333638 -color1 = #ff3f00 +color1 = #f41f1c color2 = #8bc34a color3 = #ffc107 color4 = #0266f4 @@ -32,7 +32,7 @@ color7 = #8b9396 # Bright colours color8 = #475760 -color9 = #ef5345 +color9 = #e53727 color10 = #9ccc65 color11 = #ffa000 color12 = #81b3f9 diff --git a/.profile b/.profile index 1b57803..437713a 100644 --- a/.profile +++ b/.profile @@ -29,7 +29,7 @@ export GOPATH="$HOME/.cache/go" exists() { which $@ 0<&- 1>/dev/null 2>/dev/null; } -export LESS="-RNI" +export LESS="-RI" export PAGER="less $LESS" if exists tput; then export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green diff --git a/aliases b/aliases index 7ad80ee..cfbd5d8 100644 --- a/aliases +++ b/aliases @@ -92,7 +92,6 @@ alias -s gz="tar tf" alias -s jar="java -jar" alias -s git="git clone --recursive" - # Git Aliases alias g=git alias gignore='$EDITOR .gitignore' @@ -102,7 +101,7 @@ alias gcl="git clone --recursive" alias gco="git checkout" alias gcom="git checkout master" alias ga="git add" -alias gap="git -c interactive.diffFilter=\"git diff --color-words\" add -p" +alias gap="git add -p" alias gaa="ga -A" alias grm="git rm" alias gc="git commit" @@ -130,14 +129,13 @@ alias glp="gl && gp" gd() { local commit=$1 if [ -z "$commit" ] || [ ${commit:0:1} != '@' ]; then - git diff --color-words $@ - return + git diff $@ else - git diff --color-words "@~${commit:1}^!" + git diff "@~${commit:1}^!" fi } -alias gds="git diff --staged --color-words" -alias gsh="git show --color-words" +alias gds="git diff --staged" +alias gsh="git show" alias glg="git log --stat --color" alias glog="git log --oneline --decorate --color --graph"