Compare commits

...

4 commits

Author SHA1 Message Date
Lockszmith (VAST@MacBook)
a25d87bb12 pager configuration
bat with ov are the prefered content and pager
moar is a fallback to ov
2025-04-17 18:23:26 -04:00
Lockszmith (VAST@MacBook)
68d5d29274 Add Zellij mode switching/refreshing with zellij-mode 2025-04-17 18:22:34 -04:00
Lockszmith (VAST@MacBook)
a546290cf6 Add gitcd (and czgcd) functions 2025-04-17 18:22:07 -04:00
Lockszmith (VAST@MacBook)
66ffbc9098 added bat (for use with ov) 2025-04-17 18:21:10 -04:00
4 changed files with 43 additions and 5 deletions

View file

@ -112,6 +112,16 @@
"refreshPeriod" $defaultRefresh
) -}}{{- end -}}{{- end -}}{{- end -}}
{{- with $app_name := "bat" -}}
{{- with $repo := (printf "%s/%s" "sharkdp" $app_name) -}}
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
{{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
"type" "archive-file"
"url" (printf "https://github.com/%s/releases/download/%s/%s-%s-%s.tar.gz" $repo $version $app_name $version $myArch)
"path" (printf "%s-%s-%s/%s" $app_name $version $myArch $app_name)
"refreshPeriod" $defaultRefresh
) -}}{{- end -}}{{- end -}}{{- end -}}
{{/*
# valid arch strings:
# darwin_amd64

View file

@ -24,6 +24,9 @@ if is_cmd 'chezmoi'; then
${SET_X:-:} +x
}
czcd() { chezmoi cd "${@}"; }
czgcd() {
cd "$(chezmoi git -- rev-parse --show-toplevel)${1:+/${1}}"
}
czedext() {
local CZ_EXT="$(find $(command chezmoi source-path) -mindepth 1 -maxdepth 1 -name '.chezmoiexternal.*')"
CZ_EXT="${CZ_EXT:-$(chezmoi source-path "${@}")/.chezmoiexternal.yaml.tmpl}"

View file

@ -18,12 +18,16 @@ alias lu='l -U '
alias sudo='sudo '
is_cmd ov \
&& alias less="ov " \
&& export PAGER=ov
&& alias less="ov --wrap=false " \
&& export PAGER="ov --wrap=false "
is_cmd moar \
&& alias less="moar " \
&& export PAGER=moar
if is_cmd bat; then
alias cat='bat --wrap=never '
alias less='cat '
elif is_cmd moar; then
alias less="moar " \
&& export PAGER=moar
fi
is_cmd nvim \
&& export VISUAL="nvim" EDITOR="nvim" \
@ -35,5 +39,11 @@ alias vim='nvim '
alias nvimdiff='nvim -d '
alias vimdiff='nvimdiff '
if is_cmd git; then
gitcd() {
cd "$(git rev-parse --show-toplevel)${1:+/${1}}"
}
fi
# vim: set ft=sh expandtab tabstop=4 shiftwidth=4:

View file

@ -66,6 +66,21 @@ ${SET_X-:} -x
. <( env zellij setup --generate-completion "$BASE_SHELL" )
fi
}
zellij-mode() {
local BASE="config.kdl" ROOT=~/.config/zellij
local SRC="${BASE}.${1:?Mode missing}"
[[ -s "${ROOT}/${SRC}" ]] \
|| ( printf 'Mode "%s" must exists!\n' "${1}" >&2; return 1 )
[[ -L "${ROOT}/${BASE}" || ! -e "${ROOT}/${BASE}" ]] \
|| ( printf 'config.kdl is an actual file, will not replace\n' >&2; return 2 )
if [[ "$RESET" == 'reset' ]]; then
[[ -e "${ROOT}/${BASE}" ]] && rm "${ROOT}/${BASE}"
cp "${ROOT}/${SRC}" "${ROOT}/${BASE}"
else
(cd "${ROOT}"; ln -sf "${SRC}" "${BASE}")
fi
}
${SET_X-:} -x
if [[ -n "$(env which zellij)" ]]; then
zellij-load-completion