From 0eb19bb939894ae1f3c44b92daaf3aaf92d82fff Mon Sep 17 00:00:00 2001 From: Von Random Date: Tue, 24 Jan 2017 19:48:45 +0300 Subject: [PATCH] bash now with more diff-so-fancy --- bashplugins | 15 +++++++++++++++ bashrc | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bashplugins b/bashplugins index 3ca68cb..c1e73e3 100644 --- a/bashplugins +++ b/bashplugins @@ -1,5 +1,20 @@ fuck() { echo 'no, fuck you'; } +gdiff() { /usr/bin/git diff --color "$@"; } + +gdf() +{ + local fancydiff='/usr/bin/diff-so-fancy' + local githighlight='/usr/share/git/diff-highlight/diff-highlight' + if [[ -x ${fancydiff} ]]; then + gdiff "$@" | ${fancydiff} | less --tabs=4 -RFX + elif [[ -x ${githighlight} ]]; then + gdiff "$@" | ${githighlight} | less --tabs=4 -RFX + else + gdiff "$@" + fi +} + enable_vscripts() { local vscripts="${HOME}/vscripts" diff --git a/bashrc b/bashrc index bc37983..bfd13a9 100644 --- a/bashrc +++ b/bashrc @@ -131,7 +131,6 @@ alias mountnrg='sudo mount -o loop,offset=307200' # git alias gss='command git status -s' -alias gdf='command git diff' alias gci='command git commit' alias gup='command git pull'