From e6b396aefa1a1687dc9852dad79b3fa75534f349 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:35:39 -0400 Subject: [PATCH] refactor: use whiskers@v2 --- catppuccin.gitconfig | 40 ++++++++++++++++++++-------------------- delta.tera | 42 ++++++++++++++++++++++++++++++++++++++++++ justfile | 5 +++++ template.gitconfig | 33 --------------------------------- 4 files changed, 67 insertions(+), 53 deletions(-) create mode 100644 delta.tera create mode 100644 justfile delete mode 100644 template.gitconfig diff --git a/catppuccin.gitconfig b/catppuccin.gitconfig index bb43fa0..6da5722 100644 --- a/catppuccin.gitconfig +++ b/catppuccin.gitconfig @@ -1,7 +1,7 @@ [delta "catppuccin-latte"] blame-palette = "#eff1f5 #e6e9ef #dce0e8 #ccd0da #bcc0cc" commit-decoration-style = "box ul" - dark = false + light = true file-decoration-style = "#4c4f69" file-style = "#4c4f69" hunk-header-decoration-style = "box ul" @@ -15,17 +15,17 @@ line-numbers-right-style = "#9ca0b0" line-numbers-zero-style = "#9ca0b0" # 25% red 75% base - minus-emph-style = "bold syntax #e8bac8" + minus-emph-style = "bold syntax #e8b9c6" # 10% red 90% base - minus-style = "syntax #eddbe2" + minus-style = "syntax #ecdae2" # 25% green 75% base plus-emph-style = "bold syntax #c3ddc3" # 10% green 90% base plus-style = "syntax #dee8e0" map-styles = \ - bold purple => syntax "#d6c4f4", \ + bold purple => syntax "#d5c3f4", \ bold blue => syntax "#bbcff5", \ - bold cyan => syntax "#b4dff2", \ + bold cyan => syntax "#b4def1", \ bold yellow => syntax "#ebd9bf" # Should match the name of the bat theme syntax-theme = "Catppuccin Latte" @@ -50,14 +50,14 @@ # 10% red 90% base minus-style = "syntax #433c4c" # 25% green 75% base - plus-emph-style = "bold syntax #4e5c57" + plus-emph-style = "bold syntax #4e5b56" # 10% green 90% base - plus-style = "syntax #3c444e" + plus-style = "syntax #3c444d" map-styles = \ - bold purple => syntax "#574f6f", \ - bold blue => syntax "#475271", \ - bold cyan => syntax "#4b5c6b", \ - bold yellow => syntax "#5d5a59" + bold purple => syntax "#574f6e", \ + bold blue => syntax "#475270", \ + bold cyan => syntax "#4a5b6b", \ + bold yellow => syntax "#5d5958" # Should match the name of the bat theme syntax-theme = "Catppuccin Frappe" [delta "catppuccin-macchiato"] @@ -77,18 +77,18 @@ line-numbers-right-style = "#6e738d" line-numbers-zero-style = "#6e738d" # 25% red 75% base - minus-emph-style = "bold syntax #564052" + minus-emph-style = "bold syntax #563f51" # 10% red 90% base minus-style = "syntax #383143" # 25% green 75% base - plus-emph-style = "bold syntax #455552" + plus-emph-style = "bold syntax #455450" # 10% green 90% base plus-style = "syntax #313943" map-styles = \ bold purple => syntax "#4d4569", \ bold blue => syntax "#3e4868", \ - bold cyan => syntax "#3f5365", \ - bold yellow => syntax "#585253" + bold cyan => syntax "#3f5364", \ + bold yellow => syntax "#575253" # Should match the name of the bat theme syntax-theme = "Catppuccin Macchiato" [delta "catppuccin-mocha"] @@ -110,15 +110,15 @@ # 25% red 75% base minus-emph-style = "bold syntax #53394c" # 10% red 90% base - minus-style = "syntax #35293b" + minus-style = "syntax #34293a" # 25% green 75% base - plus-emph-style = "bold syntax #40504b" + plus-emph-style = "bold syntax #404f4a" # 10% green 90% base - plus-style = "syntax #2c333a" + plus-style = "syntax #2c3239" map-styles = \ bold purple => syntax "#494060", \ - bold blue => syntax "#394361", \ - bold cyan => syntax "#384d5e", \ + bold blue => syntax "#384361", \ + bold cyan => syntax "#384d5d", \ bold yellow => syntax "#544f4e" # Should match the name of the bat theme syntax-theme = "Catppuccin Mocha" diff --git a/delta.tera b/delta.tera new file mode 100644 index 0000000..25fbcb1 --- /dev/null +++ b/delta.tera @@ -0,0 +1,42 @@ +--- +whiskers: + version: 2.4.0 + filename: "catppuccin.gitconfig" + hex_format: "#{{r}}{{g}}{{b}}" +--- + +{%- for identifier, flavor in flavors -%} +{%- set palette = flavor.colors -%} + +[delta "catppuccin-{{ identifier }}"] + blame-palette = "{{ palette.base.hex }} {{ palette.mantle.hex }} {{ palette.crust.hex }} {{ palette.surface0.hex }} {{ palette.surface1.hex }}" + commit-decoration-style = "box ul" + {{ if(cond=flavor.dark, t="dark", f="light") }} = true + file-decoration-style = "{{ palette.text.hex }}" + file-style = "{{ palette.text.hex }}" + hunk-header-decoration-style = "box ul" + hunk-header-file-style = "bold" + hunk-header-line-number-style = "bold {{ palette.subtext0.hex }}" + hunk-header-style = "file line-number syntax" + line-numbers = true + line-numbers-left-style = "{{ palette.overlay0.hex }}" + line-numbers-minus-style = "bold {{ palette.red.hex }}" + line-numbers-plus-style = "bold {{ palette.green.hex }}" + line-numbers-right-style = "{{ palette.overlay0.hex }}" + line-numbers-zero-style = "{{ palette.overlay0.hex }}" + # 25% red 75% base + minus-emph-style = "bold syntax {{ palette.red | mix(color=palette.base, amount=0.25) | get(key="hex") }}" + # 10% red 90% base + minus-style = "syntax {{ palette.red | mix(color=palette.base, amount=0.1) | get(key="hex") }}" + # 25% green 75% base + plus-emph-style = "bold syntax {{ palette.green | mix(color=palette.base, amount=0.25) | get(key="hex") }}" + # 10% green 90% base + plus-style = "syntax {{ palette.green | mix(color=palette.base, amount=0.1) | get(key="hex") }}" + map-styles = \ + bold purple => syntax "{{ palette.mauve | mix(color=palette.base, amount=0.25) | get(key="hex") }}", \ + bold blue => syntax "{{ palette.blue | mix(color=palette.base, amount=0.25) | get(key="hex") }}", \ + bold cyan => syntax "{{ palette.sky | mix(color=palette.base, amount=0.25) | get(key="hex") }}", \ + bold yellow => syntax "{{ palette.yellow | mix(color=palette.base, amount=0.25) | get(key="hex") }}" + # Should match the name of the bat theme + syntax-theme = "Catppuccin {{ identifier | capitalize }}" +{% endfor -%} diff --git a/justfile b/justfile new file mode 100644 index 0000000..9ee4e1a --- /dev/null +++ b/justfile @@ -0,0 +1,5 @@ +_default: + @just --list + +build: + whiskers delta.tera diff --git a/template.gitconfig b/template.gitconfig deleted file mode 100644 index 14e3824..0000000 --- a/template.gitconfig +++ /dev/null @@ -1,33 +0,0 @@ -{{#each flavors}} -[delta "catppuccin-{{flavor}}"] - blame-palette = "#{{base}} #{{mantle}} #{{crust}} #{{surface0}} #{{surface1}}" - commit-decoration-style = "box ul" - dark = {{isDark}} - file-decoration-style = "#{{text}}" - file-style = "#{{text}}" - hunk-header-decoration-style = "box ul" - hunk-header-file-style = "bold" - hunk-header-line-number-style = "bold #{{subtext0}}" - hunk-header-style = "file line-number syntax" - line-numbers = true - line-numbers-left-style = "#{{overlay0}}" - line-numbers-minus-style = "bold #{{red}}" - line-numbers-plus-style = "bold #{{green}}" - line-numbers-right-style = "#{{overlay0}}" - line-numbers-zero-style = "#{{overlay0}}" - # 25% red 75% base - minus-emph-style = "bold syntax #{{mix red base 0.25}}" - # 10% red 90% base - minus-style = "syntax #{{mix red base 0.1}}" - # 25% green 75% base - plus-emph-style = "bold syntax #{{mix green base 0.25}}" - # 10% green 90% base - plus-style = "syntax #{{mix green base 0.1}}" - map-styles = \ - bold purple => syntax "#{{mix mauve base 0.25}}", \ - bold blue => syntax "#{{mix blue base 0.25}}", \ - bold cyan => syntax "#{{mix sky base 0.25}}", \ - bold yellow => syntax "#{{mix yellow base 0.25}}" - # Should match the name of the bat theme - syntax-theme = "Catppuccin {{titlecase flavor}}" -{{/each}}