Skip to content

Instantly share code, notes, and snippets.

@kien
Created June 3, 2012 07:07
Show Gist options
  • Save kien/2862353 to your computer and use it in GitHub Desktop.
Save kien/2862353 to your computer and use it in GitHub Desktop.
finding local vimrc
" require Vim 7.1.299+
fu! s:localrc(...)
let path = a:0 ? expand('%:p:h', 1) : getcwd()
if path =~ '^.\+://'
retu
en
let rc = findfile('.lvimrc', path.';')
if rc != '' && filereadable(rc)
exe 'so' fnameescape(rc)
elsei !a:0
cal s:localrc(1)
en
endf
au BufEnter * cal s:localrc()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment