Vim Directory Environment Configuration

Idea
The idea is really simple. You create a  for a project directory and vim parses it whenever a file from that directory is opened. It enables some very nice features: The possibilities are virtually endless.
 * Automatic setting of  for certain filetypes for this directory.
 * Per-file configuration of other Vim options inaccessible by modelines.
 * Automatic loading of a default file (e.g. README) if no file is specified on the Vim command-line.

Configuration
Really simple, just add the following to your : " Vim Directory Environment Configuration set exrc Now, whenever you create a  file in a directory, it will be sourced by Vim after loading the global vim config but before loading any plugins. (see   for more information).

To avoid your ftplugin settings ruining your  settings, you could check if they are already defined: if !exists("&makeprg") set makeprg=rst2html.py\ %\ %.html endif

Example .vimrc
" 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