Compare commits
4 commits
1c475101d0
...
a25d87bb12
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a25d87bb12 | ||
![]() |
68d5d29274 | ||
![]() |
a546290cf6 | ||
![]() |
66ffbc9098 |
4 changed files with 43 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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}"
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue