delta
colors for delta, the git diff pager: the backgrounds of removed and added lines and of the words that changed, the file and hunk headers, line numbers and the alternating backgrounds of git blame. delta highlights the code itself with a syntax theme from bat's cache, so it needs the bat theme too.
files: rime.gitconfig · rime-glacier.gitconfig · rime-aurora.gitconfig · rime-abyss.gitconfig · rime-frost.gitconfig · on github
install
install delta and bat. on macos:
brew install git-delta baton arch:
sudo pacman -S git-delta batthen put the bat theme in bat's cache, and include the delta file in your git config:
mkdir -p "$(bat --config-dir)/themes"
curl -fsSL https://raw.githubusercontent.com/w0x7y/rime/main/general/bat/rime.tmTheme -o "$(bat --config-dir)/themes/rime.tmTheme"
bat cache --build
mkdir -p ~/.config/delta
curl -fsSL https://raw.githubusercontent.com/w0x7y/rime/main/general/delta/rime.gitconfig -o ~/.config/delta/rime.gitconfig
git config --global --add include.path ~/.config/delta/rime.gitconfig
git config --global core.pager delta
git config --global interactive.diffFilter 'delta --color-only'
git config --global delta.features rimeother variants
rime-glacier
mkdir -p "$(bat --config-dir)/themes"
curl -fsSL https://raw.githubusercontent.com/w0x7y/rime/main/general/bat/rime-glacier.tmTheme -o "$(bat --config-dir)/themes/rime-glacier.tmTheme"
bat cache --build
mkdir -p ~/.config/delta
curl -fsSL https://raw.githubusercontent.com/w0x7y/rime/main/general/delta/rime-glacier.gitconfig -o ~/.config/delta/rime-glacier.gitconfig
git config --global --add include.path ~/.config/delta/rime-glacier.gitconfig
git config --global core.pager delta
git config --global interactive.diffFilter 'delta --color-only'
git config --global delta.features rime-glacierrime-aurora
mkdir -p "$(bat --config-dir)/themes"
curl -fsSL https://raw.githubusercontent.com/w0x7y/rime/main/general/bat/rime-aurora.tmTheme -o "$(bat --config-dir)/themes/rime-aurora.tmTheme"
bat cache --build
mkdir -p ~/.config/delta
curl -fsSL https://raw.githubusercontent.com/w0x7y/rime/main/general/delta/rime-aurora.gitconfig -o ~/.config/delta/rime-aurora.gitconfig
git config --global --add include.path ~/.config/delta/rime-aurora.gitconfig
git config --global core.pager delta
git config --global interactive.diffFilter 'delta --color-only'
git config --global delta.features rime-aurorarime-abyss
mkdir -p "$(bat --config-dir)/themes"
curl -fsSL https://raw.githubusercontent.com/w0x7y/rime/main/general/bat/rime-abyss.tmTheme -o "$(bat --config-dir)/themes/rime-abyss.tmTheme"
bat cache --build
mkdir -p ~/.config/delta
curl -fsSL https://raw.githubusercontent.com/w0x7y/rime/main/general/delta/rime-abyss.gitconfig -o ~/.config/delta/rime-abyss.gitconfig
git config --global --add include.path ~/.config/delta/rime-abyss.gitconfig
git config --global core.pager delta
git config --global interactive.diffFilter 'delta --color-only'
git config --global delta.features rime-abyssrime-frost
mkdir -p "$(bat --config-dir)/themes"
curl -fsSL https://raw.githubusercontent.com/w0x7y/rime/main/general/bat/rime-frost.tmTheme -o "$(bat --config-dir)/themes/rime-frost.tmTheme"
bat cache --build
mkdir -p ~/.config/delta
curl -fsSL https://raw.githubusercontent.com/w0x7y/rime/main/general/delta/rime-frost.gitconfig -o ~/.config/delta/rime-frost.gitconfig
git config --global --add include.path ~/.config/delta/rime-frost.gitconfig
git config --global core.pager delta
git config --global interactive.diffFilter 'delta --color-only'
git config --global delta.features rime-frosteach file is a delta feature named after its variant. if you already use features, such as side-by-side, list them together:
git config --global delta.features "rime side-by-side"other variants
rime-glacier
git config --global delta.features "rime-glacier side-by-side"rime-aurora
git config --global delta.features "rime-aurora side-by-side"rime-abyss
git config --global delta.features "rime-abyss side-by-side"rime-frost
git config --global delta.features "rime-frost side-by-side"to switch variants later, add the other variant's two files the same way and change delta.features.
notes
- it sets colors only; layout options such as
line-numbersandside-by-sideare yours. - your terminal needs 24-bit color. delta assumes it when
COLORTERMistruecoloror24bit; otherwise setdelta.true-color always. - if delta warns
Unknown theme, the theme isn't in bat's cache: runbat cache --buildagain. delta reads the cache from bat's default place, so it won't find one you moved withBAT_CACHE_PATH.