1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
" Vim syntax file
" Language: C++
" Maintainer: Ken Shan <ken@digitas.harvard.edu>
" Last change: 1998 Jan 9
" Remove any old syntax stuff hanging around
syn clear
" Read the C syntax to start with
source <sfile>:p:h/c.vim
" C++ extentions
syn keyword cppStatement new delete this
syn keyword cppStatement template operator friend typename
syn keyword cppScopeDecl public protected private
syn keyword cppType inline virtual bool
syn keyword cppExceptions throw try catch
syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1
syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
syn keyword cppCast explicit
syn keyword cppStorageClass mutable
syn keyword cppNumber NPOS
syn keyword cppBoolean true false
syn match cppClassPreDecl "^\s*\(class\|struct\)\s\+[a-zA-Z_][a-zA-Z0-9_:]*\s*;"
syn match cppClassDecl "^\s*\(class\|struct\)\s\+[a-zA-Z_][a-zA-Z0-9_:]*"
" Functions ...
syn match cppFunction "^[a-zA-Z_][a-zA-Z0-9_<>:]*\s*("me=e-1
syn match cppMethod "^[a-zA-Z_][a-zA-Z0-9_<>:]*::\~\=[a-zA-Z0-9_<>:]\+\s*("me=e-1
syn match cppMethodWrapped contained "[a-zA-Z_][a-zA-Z0-9_<>:]*::[a-zA-Z0-9_<>:]\+"
syn match cppMethodWrap "^[a-zA-Z_][a-zA-Z0-9_<>:]*\s\+[a-zA-Z_][a-zA-Z0-9_<>:]*::[a-zA-Z0-9_<>:]\+\s*("me=e-1 contains=cppMethodWrapped
if !exists("did_cpp_syntax_inits")
let did_cpp_syntax_inits = 1
hi link cppClassDecl Typedef
hi link cppClassPreDecl cppStatement
hi link cppScopeDecl cppStatement
hi link cppCast cppStatement
hi link cppExceptions cppStatement
hi link cppMethod cppFunction
hi link cppStatement Statement
hi link cppType Type
hi link cppMethod Function
hi link cppFunction Function
hi link cppStorageClass StorageClass
hi link cppNumber Number
hi link cppBoolean Boolean
endif
let b:current_syntax = "cpp"
" vim: ts=8
|