Marc Weber wrote:
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
I couldn't find them.. I've implemented something similar which loads a
current working directory vimrc but saves it in .vim/vimrcs/ .. using a
simple hash function which just removes the / \\ characters ;)
Another option would be to use autocommands.. instead of modlines
au pathtoproject *.c set ft=c89
Which is used by project plugins anyway.. This way you can't forget to
add the modline..
Marc
Don't forget the event name in the ":autocmd" command.
Typical events for filetype detection are BufRead,BufNewFile and maybe
BufFilePost. (Look them up.)
Or else you could rely on the standard filetype detection:
:au Filetype c nested
\ if expand("<afile>:p") =~ "^/path/to/project/"
\ ! set ft=c89
You would of course have to write scripts to handle you new "c89"
filetype: one or more of
$VIM/vimfiles/ftplugin/c89.vim
$VIM/vimfiles/syntax/c89.vim
$VIM/vimfiles/indent/c89.vim
(Replace $VIM/vimfiles by $HOME/.vim on Unix or $HOME/vimfiles on
Windows to restrict them to one user only.) You may include the existing
c.vim scripts which will supposedly provide most of the functionality:
look at how the cpp.vim plugins do it.
Best regards,
Tony.