[nvim] Autoload project.vim files.

This commit is contained in:
Keanu Timmermans 2021-07-09 15:21:24 +02:00
parent e7a5fc498e
commit 4e9ace97db
Signed by: keanucode
GPG key ID: A7431C0D513CA93B

11
nvim/plugin/files.vim Normal file
View file

@ -0,0 +1,11 @@
" Functions {{{
function! SourceIfExists(file)
if filereadable(expand(a:file))
exe 'source ' a:file
endif
endfunction
" }}}
" Automatically load project-specific config if present
let g:proj_root = finddir('.git/..', expand('%:p:h').';')
call SourceIfExists(expand(g:proj_root..'/project.vim'))