Hello,

* On Tue, 20 Jun 2006 21:48:31 +0300, Yakov Lerner <[EMAIL PROTECTED]> wrote:
> >If not, how do you, as a human being, identify between the c89 and
> >the c99 source files?
> This is per-project. Some projects are c99. Some projects are c89.
> File extensions for both are *.c

Then you can use plugins like project.vim or local_vimrc.vim
With local_vimrc.vim (I know 2 very similar plugins with this name, I'm
maintaining one of them), add a _vimrc_local.vim (the filename expected
by default with my version) at the root of each project you are working
on. They will look like:

------------------------- >% -------------------------
" ==========================
" Definitions always loaded (everytime a buffer gains the focus)
let g:something = 1
let g:foobar    = "yes"
...

" ==========================
" Definitions loaded once per buffer

" Buffer-local anti-reinclusion guard
let s:cpo_save=&cpo
set cpo&vim
if exists('b:loaded_local_vimrc_for_project_Foo')
       \ && !exists('g:force_reload_local_vimrc_for_project_Foo')
  let &cpo=s:cpo_save
  finish
endif
let b:loaded_local_vimrc_for_project_Foo = 1

" Buffer definitions (variables, mappings, abbreviations, commands)

" EnhancedCommentify definitions for C99
let b:ECcommentOpen  = '//'
let b:ECcommentClose = ''
....

" ==========================
" Definitions loaded once per vim session
" Global anti-reinclusion guard 
if exists("g:loaded_local_vimrc_for_project_Foo") 
      \ && !exists('g:force_reload_local_vimrc_for_project_Foo)
  let &cpo=s:cpo_save
  finish 
endif
let g:loaded_local_vimrc_for_project_Foo = 1

" Global definitions (mainly functions and init tasks) 
....

" ==========================
" EOF
let &cpo=s:cpo_save
------------------------- >% -------------------------

NB: Just use the sections you are interrested in.
In my projects, I define:
- various options for the plugins and ftplugins I use
- &path, &sw, &tw
- &expandtabs that must be different for Makefiles
- compiler settings (the makefiles used and the filter applied are not
  the same from one project to another, and sometimes even within a
  particular subproject)

-- 
Luc Hermitte
http://hermitte.free.fr/vim/

Reply via email to