diff --git a/.chezmoiexternal.toml b/_home/.chezmoiexternal.toml similarity index 100% rename from .chezmoiexternal.toml rename to _home/.chezmoiexternal.toml diff --git a/.chezmoiignore b/_home/.chezmoiignore similarity index 100% rename from .chezmoiignore rename to _home/.chezmoiignore diff --git a/_home/bin/executable_sz-doctor.sh b/_home/bin/executable_sz-doctor.sh new file mode 100644 index 0000000..aa88ca1 --- /dev/null +++ b/_home/bin/executable_sz-doctor.sh @@ -0,0 +1,33 @@ +#! /usr/bin/env bash + +function check-exist() { + _TEST_RESULT='Missing' + _TEST_NAME=$1 + _TEST_PATH=${2:-$(type -fP $_TEST_NAME | head -1 2>/dev/null)} + [[ -n "$_TEST_PATH" ]] && eval "[[ ${3:--x} ${_TEST_PATH// /\\ } ]]" && _TEST_RESULT='Found' + printf "%-30s: %-8s %s \n" "$_TEST_NAME" "$_TEST_RESULT" "${4}" +} + +echo "Shell: $SHELL" +echo "" + +echo "vi editor(s) found:" +echo "$(type -fP nvim vim vi)" +echo "" + +check-exist "Byobu" "/usr/bin/byobu-launch" +check-exist "oh-my-posh" +check-exist "~/.poshtheme.omp.json" "oh-my-posh config" "-r" +check-exist "tmux" +check-exist "git" +check-exist "emacs" +check-exist "terraform" +check-exist "setxkbmap" +check-exist "chezmoi" +check-exist "gcloud" +check-exist 'bash completion' '/usr/share/bash-completion/bash_completion' '-r' +check-exist 'CodeNewRoman Nerd Font' '~/.local/share/fonts/NF_CodeNewRoman' '-d' +check-exist 'FiraCode Nerd Font' '~/.local/share/fonts/NF_FiraCode' '-d' +check-exist '~/bin' "~/bin" '-d' '(Optional)' +check-exist '~/.local/bin' "~/.local/bin" '-d' '(Optional)' +echo "" diff --git a/_home/dot_sz.shrc.d/21_aliases b/_home/dot_sz.shrc.d/21_aliases index 64b6274..6e9f992 100644 --- a/_home/dot_sz.shrc.d/21_aliases +++ b/_home/dot_sz.shrc.d/21_aliases @@ -1,7 +1,16 @@ alias sudo="/usr/bin/sudo " PREFERED_VI=$(type -fP nvim vim | head -1) -[[ -z "$PREFERED_VI" ]] && PREFERED_VI=$(type -fP vi | head -1) || alias vi_editor="$PREFERED_VI -p " -[[ -z "$PREFERED_VI" ]] && alias vi_editor='eval $EDITOR ' || alias vi_editor="$PREFERED_VI " +if [[ -z "$PREFERED_VI" ]]; then + PREFERED_VI=$(type -fP vi | head -1) + + if [[ -z "$PREFERED_VI" ]]; then + alias vi_editor='eval $EDITOR ' + else + alias vi_editor="$PREFERED_VI " + fi +else + alias vi_editor="$PREFERED_VI -p " +fi alias nvim="vi_editor " alias vim="vi_editor " alias vi="vi_editor " diff --git a/_home/dot_sz.shrc.d/bash.pre/10_check_completion b/_home/dot_sz.shrc.d/bash.pre/10_check_completion index f2427f9..3e46793 100644 --- a/_home/dot_sz.shrc.d/bash.pre/10_check_completion +++ b/_home/dot_sz.shrc.d/bash.pre/10_check_completion @@ -1 +1 @@ -[[ -x /usr/share/bash-completion/bash_completion ]] && BASH_COMPLETION_EXIST=1 +[[ -r /usr/share/bash-completion/bash_completion ]] && BASH_COMPLETION_EXIST=1