Permalink
Browse files

bin/vspec: Change &runtimepath to be customizable

  • Loading branch information...
1 parent 0f67ed2 commit 3f4ea0fa80c6131ef3281efdc4ddc6d601c5f4aa @kana committed Mar 1, 2010
Showing with 10 additions and 5 deletions.
  1. +10 −5 bin/vspec
View
@@ -8,16 +8,21 @@ fi
driver_script=",,$$.vim"
input_script="$1"
+shift # Now $@ is expanded to all {non-standard-runtimepath}s.
-cat <<END
+cat <<END >"$driver_script"
function s:main()
- let &runtimepath = substitute(&runtimepath, \
- '\\V' . escape(\$HOME, '\\') . '/.vim', \
- './vim/dot.vim', \
- 'g')
+ let standard_paths = split(&runtimepath, ',')[1:-1]
+ let non_standard_paths = ['$(echo "$@" | sed "s/ */', '/g")']
+ let all_paths = copy(standard_paths)
+ for i in non_standard_paths
+ let all_paths = [i] + all_paths + [i . '/after']
+ endfor
+ let &runtimepath = join(all_paths, ',')
+
1 verbose call vspec#test('$input_script')
qall!
endfunction

0 comments on commit 3f4ea0f

Please sign in to comment.