[Linux convenient command] Try to insert delta

less than 1 minute read

environment

Overview

When I wanted to diff, the default one had no color and the display was hard to see.
image.png

After investigating, I found that there is something called colordiff.
https://qiita.com/trapple/items/6657b903bf027464e70d

This alone seemed to be good, but I thought it would be easier to see if I used a rust product called delta, so I considered this.
https://wonderwall.hatenablog.com/entry/rust-delta

delta installation

download
$ wget https://github.com/dandavison/delta/releases/download/0.4.1/delta-0.4.1-x86_64-unknown-linux-musl.tar.gz
$ tar -zxvf delta-0.4.1-x86_64-unknown-linux-musl.tar.gz
$ cd delta-0.4.1-x86_64-unknown-linux-musl

I already have a bin file so I just had to move it

$ mv ./delta /usr/local/bin

delta setting

.gitconfig


[core]
  pager = delta
[interactive]
  diffFilter = delta --color-only

Now delta is reflected when you do git diff

Adjust various settings

.gitconfig


[delta]
  diff-so-fancy=true
  keep-plus-minus-markers=true
  minus-emph-style="bold 94 89"
  plus-emph-style="bold 29 29"
  hunk-header-style="omit"
  line-numbers=true

result

What git diff looks like

before
image.png

after
image.png

Normal diff look

This makes it easier to see because you can replace the diff when it is not git with the delta command.

before
image.png

after
image.png