Skip to content
Browse files

follow suggestion offering a command doing the same as the autocomman…

…d does
  • Loading branch information...
1 parent 15d835c commit c06fc6e260e2f5ed49ebfda6841ed823cfb04f9c @MarcWeber committed Sep 18, 2012
Showing with 8 additions and 5 deletions.
  1. +8 −5 plugin/localvimrc.vim
View
13 plugin/localvimrc.vim
@@ -69,7 +69,13 @@ fun! LVRRecurseUp(cache, dir, names)
endf
" find and source files on vim startup:
-call LVRWithCache('LVRRecurseUp', [getcwd(), s:c.names] )
+command! SourceLocalVimrc call LVRWithCache('LVRRecurseUp', [getcwd(), s:c.names] )
+command! SourceLocalVimrcOnce
+ \ if s:c.resource_on_cwd_change && s:last_cwd != getcwd()
+ \ | call LVRWithCache('LVRRecurseUp', [getcwd(), s:c.names] )
+ \ | endif
+
+SourceLocalVimrcOnce
" if its you writing a file update hash automatically
fun! LVRUpdateCache(cache)
@@ -87,9 +93,6 @@ augroup LOCAL_VIMRC
" directory - so this is only an approximation to what people might expect.
" Idle events and the like would be an alternative
if ! &autochdir
- autocmd BufNewFile,BufRead *
- \ if s:c.resource_on_cwd_change && s:last_cwd != getcwd()
- \ | call LVRWithCache('LVRRecurseUp', [getcwd(), s:c.names] )
- \ | endif
+ autocmd BufNewFile,BufRead * SourceLocalVimrcOnce
endif
augroup end

0 comments on commit c06fc6e

Please sign in to comment.
Something went wrong with that request. Please try again.