![](https://secure.gravatar.com/avatar/80decf98697d22779f6f740f8855b88c.jpg?s=120&d=mm&r=g)
[vim not recognizing filetype=c++ for Kees, but works for mental,pjrm.]
Kees is apparently using a newer version of vim (from Debian unstable) than I (Debian testing), which may well be relevant.
Excerpt of /usr/share/vim/vim62/filetype.vim on my installation:
" C++ if has("fname_case") au BufNewFile,BufRead *.cxx,*.c++,*.C,*.H,*.hh,*.hxx,*.hpp,*.moc,*.tcc,*.inl setf cpp else au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.moc,*.tcc,*.inl setf cpp endif
I've tried creating a new user (filetype=c++ works fine). This is a fairly new computer (<1 month), I'm fairly sure I haven't changed the system-wide settings.
The following excerpt just following is relevant to the possibility of omitting explicit filetype specification:
" .h files can be C or C++, set c_syntax_for_h if you want C au BufNewFile,BufRead *.h \ if exists("c_syntax_for_h") | setf c | else | setf cpp | endif
Possibly a (wishlist?) bug report should be filed if a standard install of vim from unstable doesn't support filetype=c++. However, if filetype=cpp is more widely available then I guess we should nevertheless switch to filetype=cpp.
Comments?
pjrm.