Mercurial > vim
annotate runtime/syntax/cpp.vim @ 7670:fd31843c7b58 v7.4.1134
commit https://github.com/vim/vim/commit/82e4184d489e2ce950c871354062fca40bf59598
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 19 13:50:57 2016 +0100
patch 7.4.1134
Problem: The arglist test fails on MS-Windows.
Solution: Only check for failure of argedit on Unix.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 19 Jan 2016 14:00:06 +0100 |
parents | 873eae260c97 |
children | be72f4201a1d |
rev | line source |
---|---|
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> |
7228
873eae260c97
commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
5 " Last Change: 2015 Nov 10 |
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 | |
7228
873eae260c97
commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
26 syn keyword cppModifier inline virtual explicit export |
873eae260c97
commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
27 syn keyword cppType bool wchar_t |
7 | 28 syn keyword cppExceptions throw try catch |
29 syn keyword cppOperator operator typeid | |
30 syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq | |
31 syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1 | |
32 syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$" | |
33 syn keyword cppStorageClass mutable | |
34 syn keyword cppStructure class typename template namespace | |
35 syn keyword cppBoolean true false | |
6663 | 36 syn keyword cppConstant __cplusplus |
7 | 37 |
4229 | 38 " C++ 11 extensions |
39 if !exists("cpp_no_cpp11") | |
7228
873eae260c97
commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
40 syn keyword cppModifier override final |
873eae260c97
commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
41 syn keyword cppType nullptr_t |
4229 | 42 syn keyword cppExceptions noexcept |
6663 | 43 syn keyword cppStorageClass constexpr decltype thread_local |
4229 | 44 syn keyword cppConstant nullptr |
6663 | 45 syn keyword cppConstant ATOMIC_FLAG_INIT ATOMIC_VAR_INIT |
46 syn keyword cppConstant ATOMIC_BOOL_LOCK_FREE ATOMIC_CHAR_LOCK_FREE | |
47 syn keyword cppConstant ATOMIC_CHAR16_T_LOCK_FREE ATOMIC_CHAR32_T_LOCK_FREE | |
48 syn keyword cppConstant ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE | |
49 syn keyword cppConstant ATOMIC_INT_LOCK_FREE ATOMIC_LONG_LOCK_FREE | |
50 syn keyword cppConstant ATOMIC_LLONG_LOCK_FREE ATOMIC_POINTER_LOCK_FREE | |
6823 | 51 syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell |
4229 | 52 endif |
53 | |
7228
873eae260c97
commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
54 " C++ 14 extensions |
873eae260c97
commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
55 if !exists("cpp_no_cpp14") |
873eae260c97
commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
56 syn match cppNumber display "\<0b[01]\+\(u\=l\{0,2}\|ll\=u\)\>" |
873eae260c97
commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
57 endif |
873eae260c97
commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
58 |
7 | 59 " The minimum and maximum operators in GNU C++ |
60 syn match cppMinMax "[<>]?" | |
61 | |
62 " Default highlighting | |
63 if version >= 508 || !exists("did_cpp_syntax_inits") | |
64 if version < 508 | |
65 let did_cpp_syntax_inits = 1 | |
66 command -nargs=+ HiLink hi link <args> | |
67 else | |
68 command -nargs=+ HiLink hi def link <args> | |
69 endif | |
70 HiLink cppAccess cppStatement | |
71 HiLink cppCast cppStatement | |
72 HiLink cppExceptions Exception | |
73 HiLink cppOperator Operator | |
74 HiLink cppStatement Statement | |
7228
873eae260c97
commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents:
6823
diff
changeset
|
75 HiLink cppModifier Type |
7 | 76 HiLink cppType Type |
77 HiLink cppStorageClass StorageClass | |
78 HiLink cppStructure Structure | |
79 HiLink cppBoolean Boolean | |
4229 | 80 HiLink cppConstant Constant |
6823 | 81 HiLink cppRawStringDelimiter Delimiter |
5929 | 82 HiLink cppRawString String |
7 | 83 delcommand HiLink |
84 endif | |
85 | |
86 let b:current_syntax = "cpp" | |
87 | |
88 " vim: ts=8 |