From c768ee7ad2d6f3bed4e13b7b609cd07844a9c015 Mon Sep 17 00:00:00 2001 From: Gal Szkolnik Date: Thu, 8 May 2025 15:54:30 +0000 Subject: [PATCH] Make sure delta exists before acutally using it --- chezmoi.roots/_home/dot_gitconfig.tmpl | 2 ++ chezmoi.roots/_src.all/.chezmoi.toml.tmpl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/chezmoi.roots/_home/dot_gitconfig.tmpl b/chezmoi.roots/_home/dot_gitconfig.tmpl index c3756fd..19b21b0 100644 --- a/chezmoi.roots/_home/dot_gitconfig.tmpl +++ b/chezmoi.roots/_home/dot_gitconfig.tmpl @@ -39,6 +39,7 @@ # oauthScopes = read_repository [core] editor = vim + {{- if lookPath "delta" -}} # delta will used as the default pager for git # and ov as the default pager for delta # the pager will be overloaded via the [pager] section for a few commands @@ -53,6 +54,7 @@ # It allows to maintain a simpler config file and avoid escaping quotes diff = delta --features ov-diff log = delta --features ov-log + {{- end -}} [interactive] diffFilter = delta --color-only diff --git a/chezmoi.roots/_src.all/.chezmoi.toml.tmpl b/chezmoi.roots/_src.all/.chezmoi.toml.tmpl index 7ec4f42..08ec9f3 100644 --- a/chezmoi.roots/_src.all/.chezmoi.toml.tmpl +++ b/chezmoi.roots/_src.all/.chezmoi.toml.tmpl @@ -157,6 +157,7 @@ scriptTempDir={{ $scriptTempDir | quote }} leader-key={{- $zellijLeaderKey | quote }} {{- end }} +{{- if lookPath "delta" }} [diff] # command = "nvim" # args = ["-d", "{{ "{{ .Destination }}" }}", "{{ "{{ .Target }}" }}"] @@ -164,5 +165,6 @@ scriptTempDir={{ $scriptTempDir | quote }} command = "delta" args = ["--paging=never", "{{ "{{ .Destination }}" }}", "{{ "{{ .Target }}" }}"] pager = "moar" +{{- end -}} # vim: set ft=toml expandtab tabstop=2 shiftwidth=2: