66323Re: Any way to get vim recognize emacs modeline?
- Mar 2, 2006panshizhu@... wrote:
>such as the following:You can always write your own modeline handler. General procedure:
>// -*- C++ -*-
>I don't use emacs, but many source files have this, since the standard C++
>header does not had any "extension" in the filename, it is impossible for
>Vim getting it's filetype right.
>Can Vim recognize the standard C++ header files "by default"?
a) au BufRead,BufNewFile * call MyOwnModelineHandler()
goes into your <.vimrc>
b) write MyOwnModelineHandler(). Do something like
let mp1= &modelines + 1
let modeline= search('^\%<'.mpl.'l//-\*- ','W')
let mpend= line("$") - &modelines - 1
let modeline= search('^\%>'.mpend.'l//-\*-','W')
---interpret and do whatever---
Place the function in your .vimrc or in your .vim/plugin directory.
- << Previous post in topic Next post in topic >>