Skip to content

Commit

Permalink
alias gd with dandavison/delta
Browse files Browse the repository at this point in the history
Note dandavison/delta#152
is causing a (small) change in that WS intendation is
no longer ignored, but it's still possible to use git diff -w.

PS: I also considered https://github.com/so-fancy/diff-so-fancy
but opted for delta after reading https://dandavison.github.io/delta/features.html
and seeing https://dandavison.github.io/delta/comparisons-with-other-tools.html
  • Loading branch information
vorburger committed Nov 21, 2022
1 parent 5144c85 commit 427ad70
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion dnf-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ sudo dnf install -y \
pwgen diceware \
cargo graphviz \
google-cloud-sdk google-cloud-sdk-skaffold \
python3-devel portaudio-devel
python3-devel portaudio-devel \
git-delta

# Do NOT add the "kubernetes-client" package above, but it causes this error:
# file /usr/bin/kubectl conflicts between attempted installs of kubernetes-client-1.21.0-2.fc35.x86_64 and kubectl-1.23.0-0.x86_64
Expand Down
2 changes: 1 addition & 1 deletion dotfiles/alias
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ alias gl="git ls"
alias gll="git ll"
alias glg="git lg"
alias gst="git status"
alias gd="git wdiff"
alias gd="git diff"
alias ga="git add"
alias gc="git commit -m "
alias gca="git commit --amend"
Expand Down
12 changes: 10 additions & 2 deletions dotfiles/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@
[core]
autocrlf = input
eol = native
pager = less -S
pager = delta

[interactive]
diffFilter = delta --color-only

[delta]
navigate = true # use n and N to move between diff sections
light = false # set to true if you're in a terminal w/ a light background color (e.g. the default macOS terminal)

[apply]
whitespace = fix # or “warn”, but “now” leads to “fatal: unrecognized whitespace option 'now'”
Expand All @@ -30,6 +37,7 @@
[diff]
renames = true
submodule = log
colorMoved = default

[diff "zip"]
textconv = unzip -c -a
Expand All @@ -39,6 +47,7 @@

[merge]
log = true
conflictstyle = diff3

[rerere]
enabled = true
Expand All @@ -61,7 +70,6 @@
ls = log --color --pretty=format:'%C(magenta)%h%Creset %C(white)%s%Creset %C(bold blue)<%aN>%Creset %C(dim blue)(%cN)%Creset%C(auto)%d%Creset'
ll = log --color --format=full --compact-summary
lg = log --color --graph --pretty=format:'%C(magenta)%h%Creset%C(auto)%d%Creset %s %C(bold blue)<%aN>%Creset %C(dim blue)(%cN)%Creset %C(green)(%cr)' --abbrev-commit
wdiff = diff --word-diff --word-diff-regex='\\w+'

# `tig` is a useful git log TUI alternative
[pull]
Expand Down

0 comments on commit 427ad70

Please sign in to comment.