The idea is really simple. You create a .vimrc for a project directory and vim parses it whenever a file from that directory is opened. It enables some very nice features:
makeprg for certain filetypes for this directory.
The possibilities are virtually endless.
Really simple, just add the following to your ~/.vimrc:
" Vim Directory Environment Configuration set exrc
Now, whenever you create a .vimrc file in a directory, it will be sourced by Vim after loading the global vim config but before loading any plugins. (see :h startup for more information).
To avoid your ftplugin settings ruining your .vimrc settings, you could check if they are already defined:
if !exists("&makeprg")
set makeprg=rst2html.py\ %\ %.html
endif
" check current filename: if no file was opened, open README
if @% == ""
silent open README
endif
" check current filename: if README, we must have blue colorscheme
if @% == "README"
colorscheme blue
" check filetype: if C++, set makeprg
elseif &filetype == "cpp"
set makeprg=g++\ -c\ %
" check file extension (file ends with .rst):
elseif match(@%, "\.rst$") != -1
set makeprg=rst2html.py\ %\ %.html
endif