local-vimrc: find all .vimrc.local files in the dir hierarchy and source them.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user