Merge completions into a single file

main
Buddy Sandidge 2 years ago
parent 0250cbe9b0
commit 733832a592

@ -18,11 +18,21 @@ alias wget-opendir='wget --recursive --level 0 --continue --no-clobber \
alias numfiles='find . -maxdepth 1 -type f | wc -l' alias numfiles='find . -maxdepth 1 -type f | wc -l'
alias take='sudo chown $(whoami):$(whoami) ' alias take='sudo chown $(whoami):$(whoami) '
{{ if and (lookPath "jq") (lookPath "prettier") (lookPath "bat") -}}
alias pretty_json='jq --compact-output | prettier --parser json | bat --language json' alias pretty_json='jq --compact-output | prettier --parser json | bat --language json'
{{- end }}
{{ if eq .chezmoi.os "linux" -}}
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
{{- end }}
{{ if lookPath "bat" -}}
alias batdiff='batdiff --pager=""'
alias cat=bat
{{- end }}
if [[ $(uname) == Linux ]]; then # vim: filetype=bash
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

@ -1,9 +0,0 @@
{{ if lookPath "bat" -}}
#!/usr/bin/env bash
alias batdiff='batdiff --pager=""'
if command -v bat &> /dev/null ; then
alias cat=bat
fi
{{- end }}

@ -1,8 +0,0 @@
{{ if lookPath "brew" -}}
# vi: ft=bash
if command -v brew &> /dev/null; then
if [ -f "$(brew --prefix)/share/bash-completion/bash_completion" ]; then
. "$(brew --prefix)/share/bash-completion/bash_completion"
fi
fi
{{- end }}

@ -1,28 +0,0 @@
#!/usr/bin/env bash
# shellcheck disable=SC1091
if [ -f /etc/bash_completion ]; then
source /etc/bash_completion
fi
# shellcheck disable=SC1091
if [ -f /usr/local/etc/bash_completion ]; then
source /usr/local/etc/bash_completion
fi
COMPLETION_DIR=/usr/local/etc/bash_completion.d/
if [ -d "$COMPLETION_DIR" ]; then
# shellcheck disable=SC2045
for i in $(ls "$COMPLETION_DIR"); do
file="$COMPLETION_DIR/$i"
if [ -r "${file}" ]; then
# shellcheck disable=SC1090
source "${file}"
fi
unset file
done
unset i
fi
unset COMPLETION_DIR

@ -0,0 +1,52 @@
#!/usr/bin/env bash
{{ if stat "/etc/bash_completion" -}}
# shellcheck disable=SC1091
source /etc/bash_completion
{{- end }}
{{ if stat "/usr/local/etc/bash_completion" -}}
# shellcheck disable=SC1091
source /usr/local/etc/bash_completion
{{- end }}
{{ if stat "/usr/local/etc/bash_completion.d/" -}}
for i in $(ls /usr/local/etc/bash_completion.d/); do
if [ -r "/usr/local/etc/bash_completion.d/$i" ]; then
# shellcheck disable=SC1090
source "/usr/local/etc/bash_completion.d/$i"
fi
done
unset i
{{- end }}
{{ if lookPath "brew" -}}
# vi: ft=bash
if command -v brew &> /dev/null; then
if [ -f "$(brew --prefix)/share/bash-completion/bash_completion" ]; then
. "$(brew --prefix)/share/bash-completion/bash_completion"
fi
fi
{{- end }}
{{ if lookPath "direnv" -}}
eval "$(direnv hook bash)"
{{- end }}
{{ if lookPath "erd" -}}
eval "$(erd --completions bash)"
{{- end }}
{{ if lookPath "helm" -}}
source <(helm completion bash)
{{- end }}
{{ if lookPath "kubectl" -}}
source <(kubectl completion bash)
{{- end }}
{{ if lookPath "starship" -}}
source <(starship init bash)
{{- end }}
# vim: filetype=bash

@ -1,3 +0,0 @@
{{ if lookPath "direnv" -}}
eval "$(direnv hook bash)"
{{- end }}

@ -1,3 +0,0 @@
{{ if lookPath "erd" -}}
eval "$(erd --completions bash)"
{{- end }}

@ -1,6 +0,0 @@
{{ if lookPath "kubectl" -}}
# vi: ft=bash
if command -v kubectl > /dev/null 2>&1; then
source <(kubectl completion bash)
fi
{{- end }}

@ -1,4 +0,0 @@
{{ if lookPath "starship" -}}
# vim: ft=bash
source <(starship init bash)
{{- end }}

@ -1,9 +1,9 @@
{{ if lookPath "go" -}} {{ if lookPath "go" -}}
__APPS_GO_PATH=/usr/local/apps/golang/current/bin {{ if stat "/usr/local/apps/golang/current/bin" -}}
if [ -d "${__APPS_GO_PATH}" ] && ! echo "${PATH}" | grep -q ${__APPS_GO_PATH} ; then if [ -d /usr/local/apps/golang/current/bin ] && ! echo "${PATH}" | grep -q /usr/local/apps/golang/current/bin ; then
PATH="$__APPS_GO_PATH:${PATH}" PATH="/usr/local/apps/golang/current/bin:${PATH}"
fi fi
unset __APPS_GO_PATH {{- end }}
if [ -d "${HOME}/go/bin" ] && ! echo "$PATH" | grep -q "${HOME}/go/bin" ; then if [ -d "${HOME}/go/bin" ] && ! echo "$PATH" | grep -q "${HOME}/go/bin" ; then
PATH="${PATH}:${HOME}/go/bin" PATH="${PATH}:${HOME}/go/bin"

Loading…
Cancel
Save