Skip to content

Commit

Permalink
More ndiff changes
Browse files Browse the repository at this point in the history
  • Loading branch information
arran4 authored Jul 20, 2024
1 parent 97a0f68 commit fb67e1e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
22 changes: 11 additions & 11 deletions .chezmoi.toml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@

{{- $gitCredentialManagerLocation := findExecutable "bin/git-credential-manager" $binroots -}}
{{- $vimdiffLocation := findExecutable "bin/vimdiff" $binroots -}}
{{- $nvimdiffLocation := findExecutable "bin/nvimdiff" $binroots -}}
{{- $kdiff3Location := findExecutable "bin/kdiff3" $binroots -}}
{{- $vimLocation := findExecutable "bin/vim" $binroots -}}
{{- $neovimLocation := findExecutable "bin/nvim" $binroots -}}
{{- $vimpagerLocation := findExecutable "bin/vimpager" $binroots -}}
{{- $nvimpagerLocation := findExecutable "bin/nvimpager" $binroots -}}
{{- $zshLocation := findExecutable "bin/zsh" $binroots -}}
{{- $lessLocation := findExecutable "bin/less" $binroots -}}
{{- $mvnLocation := findExecutable "bin/mvn" $binroots -}}
Expand Down Expand Up @@ -132,10 +134,12 @@
isGnome={{ $isGnome }}
gitCredentialManagerLocation="{{ $gitCredentialManagerLocation }}"
vimdiffLocation="{{ $vimdiffLocation }}"
nvimdiffLocation="{{ $nvimdiffLocation }}"
kdiff3Location="{{ $kdiff3Location }}"
vimLocation="{{ $vimLocation }}"
neovimLocation="{{ $neovimLocation }}"
vimpagerLocation="{{ $vimpagerLocation }}"
nvimpagerLocation="{{ $nvimpagerLocation }}"
gpgLocation="{{$gpgLocation}}"
zshLocation="{{$zshLocation}}"
lessLocation="{{$lessLocation}}"
Expand All @@ -148,14 +152,10 @@
terminfosearch = [{{range $each := $terminfosearch}}"{{$each}}", {{end}}]
termfallback = [{{range $each := $termfallback}}"{{$each}}", {{end}}]

#[diff]
#{{ if and (index . "headless") (lookPath "vimdiff") }}
# command = "vimdiff"
#{{ else if and (eq .chezmoi.os "linux") (lookPath "kdiff3") }}
# command = "kdiff3"
#{{ else if lookPath "vimdiff" }}
# command = "vimdiff"
#{{ end }}

#[merge]
# command = "vimdiff"
{{if stat $nvimdiffLocation -}}
[diff]
command = "$nvimdiffLocation -dm"

[merge]
command = "$nvimdiffLocation -d"
{{end -}}
5 changes: 4 additions & 1 deletion .chezmoitemplates/common-misc-env.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export WATCH=root
# No vim found!
{{- end }}

{{ if stat (index . "vimpagerLocation") -}}
{{ if stat (index . "nvimpagerLocation") -}}
# Pager IS less
export PAGER={{(index . "nvimpagerLocation")}}
{{ else if stat (index . "vimpagerLocation") -}}
# Pager IS less
export PAGER={{(index . "vimpagerLocation")}}
{{ else if stat (index . "lessLocation") -}}
Expand Down

0 comments on commit fb67e1e

Please sign in to comment.