local-vimrc: find all .vimrc.local files in the dir hierarchy and source them.

This commit is contained in:
2014-11-12 18:28:52 +04:00
parent 85c79ae795
commit b5f2f51f86

View File

@@ -38,16 +38,24 @@ function s:LoadConfig()
return
endif
let l:paths = []
let l:pathp = ""
while !filereadable(l:path.'/.vimrc') && l:pathp != l:path
while l:pathp != l:path
let l:vimrc = l:path.'/.vimrc.local'
if filereadable(l:vimrc) && l:vimrc != $MYVIMRC
let l:paths = [ l:vimrc ] + l:paths
endif
"echo 'try'.l:path
let l:pathp = l:path
let l:path = fnamemodify(l:path, ":h")
endwhile
"echo l:paths
for vimrc in l:paths
exec ":source " . vimrc
endfor
let l:vimrc = l:path . '/.vimrc'
if filereadable(l:vimrc) && l:vimrc != $MYVIMRC
exec ":source " . l:vimrc
endif
endfunction
" Section: Plugin completion