Skip to content

Instantly share code, notes, and snippets.

@mattn
Created June 18, 2010 04:51
Show Gist options
  • Save mattn/443257 to your computer and use it in GitHub Desktop.
Save mattn/443257 to your computer and use it in GitHub Desktop.
function! s:load_optional_rtp(loc)
let loc = expand(a:loc)
exe "set rtp+=".loc
let files = split(globpath(loc, '**/*.vim'), "\n")
for i in reverse(filter(files, 'filereadable(v:val)'))
if i !~ '/tests\?/'
source `=i`
endif
endfor
endfunction
"call s:load_optional_rtp("~/dev/eskk.vim")
"call s:load_optional_rtp("~/dev/chalice")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment