diff options
Diffstat (limited to 'bash/bashrc.d/vis.bash')
-rw-r--r-- | bash/bashrc.d/vis.bash | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/bash/bashrc.d/vis.bash b/bash/bashrc.d/vis.bash deleted file mode 100644 index f84cb702..00000000 --- a/bash/bashrc.d/vis.bash +++ /dev/null @@ -1,22 +0,0 @@ -# Complete args to vis(1) with existing executables in $VISPATH, defaulting to -# ~/.local/bin -_vis() { - local vispath - vispath=${VISPATH:-"$HOME"/.local/bin} - [[ -d $vispath ]] || return - while IFS= read -rd '' executable ; do - COMPREPLY[${#COMPREPLY[@]}]=$executable - done < <( - shopt -s dotglob nullglob - declare -a files - files=("${VISPATH:-"$HOME"/.local/bin}"/"${COMP_WORDS[COMP_CWORD]}"*) - declare -a executables - for file in "${files[@]}" ; do - [[ -f $file && -x $file ]] || continue - executables[${#executables[@]}]=${file##*/} - done - ((${#executables[@]})) || exit 1 - printf '%q\0' "${executables[@]}" - ) -} -complete -F _vis vis |