diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2014-02-10 23:54:25 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2014-02-10 23:54:25 +1300 |
commit | 79309afa6f6d8b4f3a607694608b499db6b992fa (patch) | |
tree | 627a59b4d7182ccca6d7bfb613895e876bfd25ed /bash/bashrc.d/vim.bash | |
parent | Add comment (diff) | |
download | dotfiles-79309afa6f6d8b4f3a607694608b499db6b992fa.tar.gz dotfiles-79309afa6f6d8b4f3a607694608b499db6b992fa.zip |
Use space before semicolon as command separator
Diffstat (limited to 'bash/bashrc.d/vim.bash')
-rw-r--r-- | bash/bashrc.d/vim.bash | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bash/bashrc.d/vim.bash b/bash/bashrc.d/vim.bash index 036dc1da..b929cf80 100644 --- a/bash/bashrc.d/vim.bash +++ b/bash/bashrc.d/vim.bash @@ -1,5 +1,5 @@ # Bail if no vim(1) -if ! hash vim 2>/dev/null; then +if ! hash vim 2>/dev/null ; then return fi @@ -15,10 +15,10 @@ vis() { # Distinguish options from file arguments endopts=0 - for arg in "$@"; do - if [[ $arg == -- ]]; then + for arg in "$@" ; do + if [[ $arg == -- ]] ; then endopts=1 - elif [[ $arg == -* ]] && ! ((endopts)); then + elif [[ $arg == -* ]] && ! ((endopts)) ; then opts=("${opts[@]}" "$arg") else cmds=("${cmds[@]}" "$arg") @@ -26,9 +26,9 @@ vis() { done # Check all the commands, if they don't exist, we'll create them - for cmd in "${cmds[@]}"; do + for cmd in "${cmds[@]}" ; do file=$(type -p "${cmd##*/}") - if [[ ! $file ]]; then + if [[ ! $file ]] ; then mkdir -p "$HOME"/.local/bin || exit file="$HOME"/.local/bin/"${cmd##*/}" fi |