Made vim highlighting work mostly how I want now.
I made `cpp.cplusplus` a hybrid filetype which tricks the vim highlighting into believing that we're really in raw C++ for the purposes of the core vim highlighting rules. My `cplusplus` type adds more bits to the core stuff, but mostly exists to let doxygen slip in the way that I want it to.
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
" Cynlib
|
||||
" .cc and .cpp files can be C++ or Cynlib.
|
||||
au BufNewFile,BufRead *.cc
|
||||
\ if exists("cynlib_syntax_for_cc")|setf cynlib|else|setf cplusplus|endif
|
||||
\ if exists("cynlib_syntax_for_cc")|setf cynlib|else|set filetype=cpp.cplusplus|endif
|
||||
au BufNewFile,BufRead *.cpp
|
||||
\ if exists("cynlib_syntax_for_cpp")|setf cynlib|else|setf cplusplus|endif
|
||||
\ if exists("cynlib_syntax_for_cpp")|setf cynlib|else|set filetype=cpp.cplusplus|endif
|
||||
|
||||
" C++
|
||||
au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.ipp,*.moc,*.tcc,*.inl setf cplusplus
|
||||
au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.ipp,*.moc,*.tcc,*.inl set filetype=cpp.cplusplus
|
||||
if has("fname_case")
|
||||
au BufNewFile,BufRead *.C,*.H setf cplusplus
|
||||
au BufNewFile,BufRead *.C,*.H set filetype=cpp.cplusplus
|
||||
endif
|
||||
|
||||
function! CheckForADAM()
|
||||
@ -23,13 +23,13 @@ function! CheckForADAM()
|
||||
elseif exists("g:ch_syntax_for_h")
|
||||
setf ch
|
||||
else
|
||||
setf cplusplus
|
||||
setf cpp.cplusplus
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" .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 setf cplusplus "call CheckForADAM()
|
||||
au BufNewFile,BufRead *.cxx,*.cpp,*.hpp,*.cc,*.h setf cplusplus
|
||||
au BufNewFile,BufRead *.h setf cpp.cplusplus "call CheckForADAM()
|
||||
au BufNewFile,BufRead *.cxx,*.cpp,*.hpp,*.cc,*.h setf cpp.cplusplus
|
||||
|
||||
|
||||
Reference in New Issue
Block a user