diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2014-10-13 17:47:08 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2014-10-13 17:47:08 +1300 |
commit | 498954539dec625e8e53637f96b32658105d1631 (patch) | |
tree | 08d477fb3e2042d136f2ee7a794b36a5403b7a3b /bash/bashrc.d/vis.bash | |
parent | Remembered that VERSINFO[2] is broken on 2.05a (diff) | |
download | dotfiles-498954539dec625e8e53637f96b32658105d1631.tar.gz dotfiles-498954539dec625e8e53637f96b32658105d1631.zip |
Remove never-used vis function
Diffstat (limited to 'bash/bashrc.d/vis.bash')
-rw-r--r-- | bash/bashrc.d/vis.bash | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/bash/bashrc.d/vis.bash b/bash/bashrc.d/vis.bash deleted file mode 100644 index ffcfe02a..00000000 --- a/bash/bashrc.d/vis.bash +++ /dev/null @@ -1,39 +0,0 @@ -# Create or edit a script in $PATH, creating in $HOME/.local/bin -vis() { - local arg cmd file endopts - local -a opts cmds files - - # Distinguish options from file arguments - endopts=0 - for arg in "${@:?}" ; do - if [[ $arg == -- ]] ; then - endopts=1 - elif [[ $arg == -* ]] && ! ((endopts)) ; then - opts=("${opts[@]}" "$arg") - else - cmds=("${cmds[@]}" "$arg") - fi - done - - # Check all the commands, if they don't exist, we'll create them - for cmd in "${cmds[@]}" ; do - file=$(type -p "${cmd##*/}") - if [[ ! $file ]] ; then - if ! mkdir -p "$HOME"/.local/bin ; then - exit - fi - file="$HOME"/.local/bin/"${cmd##*/}" - fi - files=("${files[@]}" "$file") - done - - # Run editor with all the options and full path file arguments - command "${VISUAL:-${EDITOR:-vi}}" "${opts[@]}" -- "${files[@]}" - - # Attempt to make the new files executable by us - chmod -f -- u+x "${files[@]}" -} - -# Complete the vis function with command names -complete -A command vis - |