diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index 560ca9c..6fa983d 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -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" -}} @@ -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 }} @@ -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}}] diff --git a/.chezmoitemplates/common-misc-env.tmpl b/.chezmoitemplates/common-misc-env.tmpl index 466290d..0aca250 100644 --- a/.chezmoitemplates/common-misc-env.tmpl +++ b/.chezmoitemplates/common-misc-env.tmpl @@ -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 }} diff --git a/.chezmoitemplates/shell-aliases.tmpl b/.chezmoitemplates/shell-aliases.tmpl index a92e132..9338b99 100644 --- a/.chezmoitemplates/shell-aliases.tmpl +++ b/.chezmoitemplates/shell-aliases.tmpl @@ -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' diff --git a/bin/.keep b/dot_local/bin/.keep similarity index 100% rename from bin/.keep rename to dot_local/bin/.keep diff --git a/bin/executable_compress.sh b/dot_local/bin/executable_compress.sh similarity index 100% rename from bin/executable_compress.sh rename to dot_local/bin/executable_compress.sh diff --git a/bin/executable_disable-touchpad.sh b/dot_local/bin/executable_disable-touchpad.sh similarity index 100% rename from bin/executable_disable-touchpad.sh rename to dot_local/bin/executable_disable-touchpad.sh diff --git a/bin/executable_extract.sh b/dot_local/bin/executable_extract.sh similarity index 100% rename from bin/executable_extract.sh rename to dot_local/bin/executable_extract.sh diff --git a/bin/executable_screenshot-location_mac.sh b/dot_local/bin/executable_screenshot-location_mac.sh similarity index 100% rename from bin/executable_screenshot-location_mac.sh rename to dot_local/bin/executable_screenshot-location_mac.sh diff --git a/bin/executable_whatsmyip.sh b/dot_local/bin/executable_whatsmyip.sh similarity index 100% rename from bin/executable_whatsmyip.sh rename to dot_local/bin/executable_whatsmyip.sh