diff --git a/zshrc b/zshrc index a005f79..957e51a 100644 --- a/zshrc +++ b/zshrc @@ -112,6 +112,21 @@ bindkey '^R' history-incremental-search-backward # ctrl + r bindkey '^[m' copy-prev-shell-word # alt + m bindkey -s '^j' '^atime ^m' # ctrl + j # }}} +# {{{ functions +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 -RSFX + elif [[ -x ${githighlight} ]]; then + gdiff "$@" | ${githighlight} | less --tabs=4 -RSFX + else + gdiff "$@" + fi +} +# }}} # {{{ aliases alias less='command less -R' alias ltail='command less -R +F' @@ -181,13 +196,6 @@ fi alias rscreen='command screen -Dr' alias scr='command screen sudo -Es' # }}} -# {{{ plugins and traps -#plugins="${HOME}/.bashplugins" -#[[ -r "${plugins}" && "$BASH_VERSINFO" -ge 4 ]] && . "${plugins}" -# -## we want to see exit code on error (it also has to be the last entry here) -#trap 'printf "${red}>>${reset} ${bold}exit${reset} ${red}%s${reset}\n" "$?" >&2' ERR -# }}} # {{{ global aliases alias -g L='| less -R' alias -g H='| head'