diff --git a/git/.config/git/config b/git/.config/git/config index 8f56266..10b6bd8 100644 --- a/git/.config/git/config +++ b/git/.config/git/config @@ -6,6 +6,8 @@ defaultBranch = main [core] pager = delta +[pager] + difftool = true [interactive] diffFilter = delta --color-only [merge] @@ -23,6 +25,7 @@ pushall = "!git remote | xargs -I R git push R" # push to all connected remotes fetchall = "!git remote | xargs -I R git fetch R" # fetch from all connected remotes diffword = "!git diff --word-diff=color --word-diff-regex='[0-9A-Za-z_]+'" # word-wise diff, good for prose + diffsyn = "!git difftool --tool difftastic" # add syntax-driven diff using treesitter [commit] gpgsign = true # sign commits as me verbose = true # Always show diff when preparing commit message @@ -32,6 +35,10 @@ rebase = true # always rebase on pulling, obviates merge commits [diff] colorMoved = zebra # also color stuff that has simply been moved, in a classy zebra-color +[difftool] + prompt = false +[difftool "difftastic"] + cmd = difft "$LOCAL" "$REMOTE" [color.diff] meta = "9" frag = "magenta bold" diff --git a/git/.config/sh/alias.d/git.sh b/git/.config/sh/alias.d/git.sh index ad465f6..5e84cae 100644 --- a/git/.config/sh/alias.d/git.sh +++ b/git/.config/sh/alias.d/git.sh @@ -38,8 +38,13 @@ alias gdds='git diffword --staged' alias gi='git ignore' +# syntax-based diff +if exist difft; then + alias gdy='git diffsyn' + alias gdys='git diffsyn --staged' +fi # show last committed content -alias gll='git last' +alias gdl='git last' # show quick log overview alias glg='git log --oneline --decorate --graph' alias glgd="git log --graph --pretty=format:'%C(auto)%h%Creset %C(cyan)%ar%Creset%C(auto)%d%Creset %s'"