7
|
1 " Vim syntax file
|
|
2 " Language: C++
|
6663
|
3 " Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
4229
|
4 " Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
6823
|
5 " Last Change: 2015 May 04
|
7
|
6
|
|
7 " For version 5.x: Clear all syntax items
|
|
8 " For version 6.x: Quit when a syntax file was already loaded
|
|
9 if version < 600
|
|
10 syntax clear
|
|
11 elseif exists("b:current_syntax")
|
|
12 finish
|
|
13 endif
|
|
14
|
|
15 " Read the C syntax to start with
|
|
16 if version < 600
|
|
17 so <sfile>:p:h/c.vim
|
|
18 else
|
|
19 runtime! syntax/c.vim
|
|
20 unlet b:current_syntax
|
|
21 endif
|
|
22
|
4229
|
23 " C++ extensions
|
7
|
24 syn keyword cppStatement new delete this friend using
|
|
25 syn keyword cppAccess public protected private
|
|
26 syn keyword cppType inline virtual explicit export bool wchar_t
|
|
27 syn keyword cppExceptions throw try catch
|
|
28 syn keyword cppOperator operator typeid
|
|
29 syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq
|
|
30 syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1
|
|
31 syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
|
|
32 syn keyword cppStorageClass mutable
|
|
33 syn keyword cppStructure class typename template namespace
|
|
34 syn keyword cppBoolean true false
|
6663
|
35 syn keyword cppConstant __cplusplus
|
7
|
36
|
4229
|
37 " C++ 11 extensions
|
|
38 if !exists("cpp_no_cpp11")
|
|
39 syn keyword cppType override final
|
|
40 syn keyword cppExceptions noexcept
|
6663
|
41 syn keyword cppStorageClass constexpr decltype thread_local
|
4229
|
42 syn keyword cppConstant nullptr
|
6663
|
43 syn keyword cppConstant ATOMIC_FLAG_INIT ATOMIC_VAR_INIT
|
|
44 syn keyword cppConstant ATOMIC_BOOL_LOCK_FREE ATOMIC_CHAR_LOCK_FREE
|
|
45 syn keyword cppConstant ATOMIC_CHAR16_T_LOCK_FREE ATOMIC_CHAR32_T_LOCK_FREE
|
|
46 syn keyword cppConstant ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE
|
|
47 syn keyword cppConstant ATOMIC_INT_LOCK_FREE ATOMIC_LONG_LOCK_FREE
|
|
48 syn keyword cppConstant ATOMIC_LLONG_LOCK_FREE ATOMIC_POINTER_LOCK_FREE
|
6823
|
49 syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
|
4229
|
50 endif
|
|
51
|
7
|
52 " The minimum and maximum operators in GNU C++
|
|
53 syn match cppMinMax "[<>]?"
|
|
54
|
|
55 " Default highlighting
|
|
56 if version >= 508 || !exists("did_cpp_syntax_inits")
|
|
57 if version < 508
|
|
58 let did_cpp_syntax_inits = 1
|
|
59 command -nargs=+ HiLink hi link <args>
|
|
60 else
|
|
61 command -nargs=+ HiLink hi def link <args>
|
|
62 endif
|
|
63 HiLink cppAccess cppStatement
|
|
64 HiLink cppCast cppStatement
|
|
65 HiLink cppExceptions Exception
|
|
66 HiLink cppOperator Operator
|
|
67 HiLink cppStatement Statement
|
|
68 HiLink cppType Type
|
|
69 HiLink cppStorageClass StorageClass
|
|
70 HiLink cppStructure Structure
|
|
71 HiLink cppBoolean Boolean
|
4229
|
72 HiLink cppConstant Constant
|
6823
|
73 HiLink cppRawStringDelimiter Delimiter
|
5929
|
74 HiLink cppRawString String
|
7
|
75 delcommand HiLink
|
|
76 endif
|
|
77
|
|
78 let b:current_syntax = "cpp"
|
|
79
|
|
80 " vim: ts=8
|