diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index c2f24c2..639ede2 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -67,7 +67,6 @@ {{- $vimpagerLocation := findExecutable "bin/vimpager" $binroots -}} {{- $zshLocation := findExecutable "bin/zsh" $binroots -}} {{- $lessLocation := findExecutable "bin/less" $binroots -}} -{{- $manpagerLocation := findExecutable "bin/manpager" $binroots -}} {{- $mvnLocation := findExecutable "bin/mvn" $binroots -}} {{- if and (eq .chezmoi.os "linux") (not (stat $gitCredentialManagerLocation )) -}} @@ -98,10 +97,6 @@ {{- writeToStdout "Can't find zsh \n" -}} {{- end -}} -{{- if and (not (eq .chezmoi.os "windows")) (not (stat $manpagerLocation )) -}} - {{- writeToStdout "Can't find man pager \n" -}} -{{- end -}} - {{- if and (not (eq .chezmoi.os "windows")) (not (stat $lessLocation )) -}} {{- writeToStdout "Can't find less \n" -}} {{- end -}} @@ -127,7 +122,6 @@ vimpagerLocation="{{ $vimpagerLocation }}" gpgLocation="{{$gpgLocation}}" zshLocation="{{$zshLocation}}" - manpagerLocation="{{$manpagerLocation}}" lessLocation="{{$lessLocation}}" mvnLocation="{{$mvnLocation}}" optbins = [{{range $each := $optbins}}"{{$each}}", {{end}}] diff --git a/.chezmoitemplates/common-misc-env.tmpl b/.chezmoitemplates/common-misc-env.tmpl index 0aca250..0a13659 100644 --- a/.chezmoitemplates/common-misc-env.tmpl +++ b/.chezmoitemplates/common-misc-env.tmpl @@ -10,13 +10,10 @@ export WATCH=root # No vim found! {{- end }} -{{ if stat (index . "manpagerLocation") -}} - export MANPAGER='{{(index . "manpagerLocation")}}' +{{ if stat (index . "vimpagerLocation") -}} # Pager IS less - export PAGER={{(index . "lessLocation")}} + export PAGER={{(index . "vimpagerLocation")}} {{ else if stat (index . "lessLocation") -}} - # Don’t clear the screen after quitting a manual page. - export MANPAGER='{{(index . "lessLocation")}} -is -R -X' # Pager IS less export PAGER={{(index . "lessLocation")}} {{- else -}} diff --git a/.chezmoitemplates/shell-man-env.tmpl b/.chezmoitemplates/shell-man-env.tmpl index 05b9c16..c054218 100644 --- a/.chezmoitemplates/shell-man-env.tmpl +++ b/.chezmoitemplates/shell-man-env.tmpl @@ -1 +1,14 @@ # TODO oneday Manpage path discovery + +{{ if stat (index . "vimpagerLocation") -}} + export MANPAGER='{{(index . "vimpagerLocation")}}' + # Pager IS less + export PAGER={{(index . "vimpagerLocation")}} +{{ else if stat (index . "lessLocation") -}} + # Don’t clear the screen after quitting a manual page. + export MANPAGER='{{(index . "lessLocation")}} -is -R -X' + # Pager IS less + export PAGER={{(index . "lessLocation")}} +{{- else -}} + # No less found! +{{- end }}