git: Add side-by-side diff

Added a simple alteration of diff viewing to also be feasible side-by-side in
addition to the default (delta) diff viewing mode.
Use aliases `gdd` (and `gdds` for staged) to enable.
This commit is contained in:
Marty Oehme 2023-12-12 12:17:19 +01:00
parent 13c87f365d
commit 62ec2799c8
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 7 additions and 0 deletions

View file

@ -26,6 +26,7 @@
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
diffside = "!DELTA_FEATURES='+side-by-side' git diff" # add side-by-side diffing
[commit]
gpgsign = true # sign commits as me
verbose = true # Always show diff when preparing commit message

View file

@ -38,6 +38,12 @@ alias gdds='git diffword --staged'
alias gi='git ignore'
# word-based diff (with custom word regex)
alias gdw='git diffword'
alias gdws='git diffword --staged'
# side-by-side diff
alias gdd='git diffside'
alias gdds='git diffside --staged'
# syntax-based diff
if exist difft; then
alias gdy='git diffsyn'