git: Add word-wise diff as quick alias

Since I often use git for prose and textual writing, wordwise
diffs make a lot of sense to have quick access to. This commit
sets up a git-internal alias `git diffword` as well as an
even shorter `gdd` (diff) and `gdds` (diff staged) which
mimic the other diff aliases `gd`/`gds` already existing.
This commit is contained in:
Marty Oehme 2023-10-05 18:09:48 +02:00
parent 1040c82bea
commit 0acfe2d5d0
Signed by: Marty
GPG Key ID: EDBF2ED917B2EF6A
2 changed files with 3 additions and 0 deletions

View File

@ -22,6 +22,7 @@
last = "diff HEAD~ HEAD"
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
[commit]
gpgsign = true # sign commits as me
verbose = true # Always show diff when preparing commit message

View File

@ -32,7 +32,9 @@ fi
alias gco='git checkout'
alias gd='git diff'
alias gdd='git diffword'
alias gds='git diff --staged'
alias gdds='git diffword --staged'
alias gi='git ignore'