Skip to content

Commit

Permalink
man pager is a bit stranger
Browse files Browse the repository at this point in the history
  • Loading branch information
arran4 authored May 22, 2024
1 parent 3d52e7c commit af207ab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
6 changes: 0 additions & 6 deletions .chezmoi.toml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 )) -}}
Expand Down Expand Up @@ -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 -}}
Expand All @@ -127,7 +122,6 @@
vimpagerLocation="{{ $vimpagerLocation }}"
gpgLocation="{{$gpgLocation}}"
zshLocation="{{$zshLocation}}"
manpagerLocation="{{$manpagerLocation}}"
lessLocation="{{$lessLocation}}"
mvnLocation="{{$mvnLocation}}"
optbins = [{{range $each := $optbins}}"{{$each}}", {{end}}]
Expand Down
7 changes: 2 additions & 5 deletions .chezmoitemplates/common-misc-env.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
13 changes: 13 additions & 0 deletions .chezmoitemplates/shell-man-env.tmpl
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit af207ab

Please sign in to comment.