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:
2018-06-22 01:16:34 -04:00
parent 2d9b12eeb4
commit 0058505789
3 changed files with 31 additions and 22 deletions

View File

@ -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