> I wonder how often the detection will fail. "@interface" and "@end"
> could appear in a comment of a C or C++ file, at least. Esp. when
> using
> something like doxygen.
What about '[EMAIL PROTECTED]|[EMAIL PROTECTED]' (and maybe throw in a
'\|[EMAIL PROTECTED]' at
the end for good measure)?
> The check could be turned into a one liner:
>
> " .h files can be C, Ch C++, ObjC or ObjC++.
> " Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch.
> ObjC is
> " detected automatically.
> au BufNewFile,BufRead *.h call s:FTheader()
>
> func! s:FTheader()
> if match(getline(1, min([line("$"), 200])), '@interface\|@end') > -1
If we add the '^'s and '\|[EMAIL PROTECTED]', this line would be > 80 chars.
>
> setf objc
> elseif exists("c_syntax_for_h")
> setf c
> elseif exists("ch_syntax_for_h")
> setf ch
> else
> setf cpp
> endif
> endfunc
Nico
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---