Skip to content

Commit

Permalink
More path changes in more ways than one
Browse files Browse the repository at this point in the history
  • Loading branch information
arran4 authored May 22, 2024
1 parent 8c3c67d commit 74a5aa1
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 9 deletions.
17 changes: 17 additions & 0 deletions .chezmoi.toml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
{{- $vimLocation := findExecutable "bin/vim" $binroots -}}
{{- $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 )) -}}
{{- writeToStdout "Can't find GCM: https://github.com/GitCredentialManager/git-credential-manager/releases \n" -}}
Expand Down Expand Up @@ -95,6 +98,18 @@
{{- 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 -}}

{{- if not (stat $mvnLocation ) -}}
{{- writeToStdout "Can't find maven (mvn) \n" -}}
{{- end -}}

[git]
autoCommit = {{ $autoGit }}
autoPush = {{ $autoGit }}
Expand All @@ -112,6 +127,8 @@
vimpagerLocation="{{ $vimpagerLocation }}"
gpgLocation="{{$gpgLocation}}"
zshLocation="{{$zshLocation}}"
manpagerLocation="{{$manpagerLocation}}"
lessLocation="{{$lessLocation}}"
optbins = [{{range $each := $optbins}}"{{$each}}", {{end}}]
usrbins = [{{range $each := $usrbins}}"{{$each}}", {{end}}]
usrlocalbins = [{{range $each := $usrlocalbins}}"{{$each}}", {{end}}]
Expand Down
18 changes: 9 additions & 9 deletions .chezmoitemplates/common-misc-env.tmpl
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
export WATCHFMT="%D %T %n@%l.%M %a"
export WATCH=root

{{if stat "/usr/bin/vim" -}}
{{if stat (index . "vimLocation") -}}
# Make vim the default editor.
export EDITOR='/usr/bin/vim'
export VISUAL=/usr/bin/vim
export EDITOR='{{(index . "vimLocation")}}'
export VISUAL={{(index . "vimLocation")}}
export ALTERNATE_EDITOR=''
{{- else -}}
# No vim found!
{{- end }}

{{ if stat "/usr/bin/manpager" -}}
export MANPAGER='/usr/bin/manpager'
{{ if stat (index . "manpagerLocation") -}}
export MANPAGER='{{(index . "manpagerLocation")}}'
# Pager IS less
export PAGER=/usr/bin/less
{{ else if stat "/usr/bin/less" -}}
export PAGER={{(index . "lessLocation")}}
{{ else if stat (index . "lessLocation") -}}
# Don’t clear the screen after quitting a manual page.
export MANPAGER='/usr/bin/less -is -R -X'
export MANPAGER='{{(index . "lessLocation")}} -is -R -X'
# Pager IS less
export PAGER=/usr/bin/less
export PAGER={{(index . "lessLocation")}}
{{- else -}}
# No less found!
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions .chezmoitemplates/shell-aliases.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ alias ...="cd ../.. && ls"
# Get week number
alias week='date +%V'

{{ if stat (index . "mvnLocation")}}
# M2 nav
alias pushd_m2='pushd ~/.m2/'
{{end}}

{{- if index $ "isWsl" }}
alias open='explorer.exe'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 74a5aa1

Please sign in to comment.