Say, there are a lot of files in the tree with vim hints at the bottom. (I think these are from Ted?) I'd like to change them to drop the "filetype=c++" part. That seems to break my vim and uncolorizes everything. I think it's breaking the autodetection.
On Sat, 2004-04-17 at 02:07, Kees Cook wrote:
Say, there are a lot of files in the tree with vim hints at the bottom. (I think these are from Ted?) I'd like to change them to drop the "filetype=c++" part. That seems to break my vim and uncolorizes everything. I think it's breaking the autodetection.
Perhaps you need to install the C++ vim mode? It works fine with my vim installation.
-mental
On Sat, Apr 17, 2004 at 01:35:07PM -0400, MenTaLguY wrote:
Perhaps you need to install the C++ vim mode? It works fine with my vim installation.
Hm... digging into vim, it looks like mine is named "cpp". And none of the vim docs even hint at calling this "c++". How is yours installed?
On Sat, Apr 17, 2004 at 11:06:52AM -0700, Kees Cook wrote:
On Sat, Apr 17, 2004 at 01:35:07PM -0400, MenTaLguY wrote:
Perhaps you need to install the C++ vim mode? It works fine with my vim installation.
Hm... digging into vim, it looks like mine is named "cpp". And none of the vim docs even hint at calling this "c++". How is yours installed?
For me (default Debian install of vim 6.2, including patches 1-149), c++ and cpp each work. I've no big objection to a global change to filetype=cpp (except that it isn't as clear as c++, e.g. could mean C preprocessor or something else I haven't thought of). Kees, do you have a reasonably recent vim installation?
I would object to removing the filetype=blah specification for .h files (vim would wrongly guess C, which behaves differently for e.g. private/public/protected), and I would object to having different settings for .h and .cpp files. However, I don't usually use vim for C/C++ development.
I've just discovered today that the c-file-offsets line should also have `(case-label . +)' in the alist to conform to the examples in the CodingStyle page (case statements indented by one quantum from the switch statement). This change and the filetype change (if any) can be done as one commit.
pjrm.
On Sun, Apr 18, 2004 at 10:58:45PM +1000, Peter Moulder wrote:
For me (default Debian install of vim 6.2, including patches 1-149), c++ and cpp each work. I've no big objection to a global change to filetype=cpp (except that it isn't as clear as c++, e.g. could mean C preprocessor or something else I haven't thought of). Kees, do you have a reasonably recent vim installation?
Using this: http://www.debian.org/distrib/packages#search_contents I can't find a "c++.vim". I have the latest vim installed: ii vim 6.2-426+1 Vi IMproved - enhanced vi editor ii vim-common 6.2-426+1 Vi IMproved - Common files ii vim-doc 6.2-426+1 Vi IMproved - Documentation files
It doesn't appear to be my .vimrc (I moved it out of the way to test). And I can't figure out how to make an "alias" for a syntax name.
I would object to removing the filetype=blah specification for .h files (vim would wrongly guess C, which behaves differently for e.g.
If I can get this fixed, I'll add a vim hint to every file in the source. ;) I just don't know what I should try next to get it fixed.
[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.
participants (3)
-
Kees Cook
-
MenTaLguY
-
Peter Moulder