Created
January 8, 2012 22:49
-
-
Save mattsacks/1579990 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" if the current buffer has a different working directory than the one when | |
" Vim starts, source the .localvimrc | |
augroup Localvimrc | |
autocmd! | |
autocmd VimEnter * if filereadable('.localvimrc') | |
\| so .localvimrc | |
\| endif | |
\| let g:localvimrc_directory = getcwd() | |
autocmd BufEnter,BufNewFile * if getcwd() != g:localvimrc_directory && filereadable('.localvimrc') | |
\| so .localvimrc | |
\| endif | |
augroup END | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment