diff --git a/vim/plugin/local-vimrc.vim b/vim/plugin/local-vimrc.vim index b4a32f8..eafb3cf 100644 --- a/vim/plugin/local-vimrc.vim +++ b/vim/plugin/local-vimrc.vim @@ -26,14 +26,22 @@ let g:loaded_local_vimrc=1 " Section: Event group setup " Act when creating or loading a file augroup LocalVimrc - au BufNewFile,BufRead * call s:LoadConfig() + au BufNewFile,BufRead * call s:LocalVimrcLoadForFile() augroup END " Function: LoadConfig() " -" If the file .vimrc exists in the root of a git project - load it -function s:LoadConfig() +" If the file .vimrc exists in the path - load it +function s:LocalVimrcLoadForFile() let l:path = fnameescape(expand("%:p:h")) + call g:LocalVimrcLoad( l:path ) +endfunction + +" Function: LocalVimrcLoad() +" +" If the file .vimrc exists in the path - load it +function! g:LocalVimrcLoad(path) + let l:path = a:path if empty(l:path) return endif