|
|
22c937 |
" Vim syntax file
|
|
|
22c937 |
" Language: C++
|
|
|
22c937 |
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
|
|
22c937 |
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
|
|
22c937 |
" Last Change: 2015 Mar 1
|
|
|
22c937 |
" For version 5.x: Clear all syntax items
|
|
|
22c937 |
" For version 6.x: Quit when a syntax file was already loaded
|
|
|
22c937 |
if version < 600
|
|
|
22c937 |
syntax clear
|
|
|
22c937 |
elseif exists("b:current_syntax")
|
|
|
22c937 |
finish
|
|
|
22c937 |
endif
|
|
|
22c937 |
" Read the C syntax to start with
|
|
|
22c937 |
if version < 600
|
|
|
22c937 |
so <sfile>:p:h/c.vim
|
|
|
22c937 |
else
|
|
|
22c937 |
runtime! syntax/c.vim
|
|
|
22c937 |
unlet b:current_syntax
|
|
|
22c937 |
endif
|
|
|
22c937 |
" C++ extensions
|
|
|
22c937 |
syn keyword cppStatement new delete this friend using
|
|
|
22c937 |
syn keyword cppAccess public protected private
|
|
|
22c937 |
syn keyword cppType inline virtual explicit export bool wchar_t
|
|
|
22c937 |
syn keyword cppExceptions throw try catch
|
|
|
22c937 |
syn keyword cppOperator operator typeid
|
|
|
22c937 |
syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq
|
|
|
22c937 |
syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1
|
|
|
22c937 |
syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
|
|
|
22c937 |
syn keyword cppStorageClass mutable
|
|
|
22c937 |
syn keyword cppStructure class typename template namespace
|
|
|
22c937 |
syn keyword cppBoolean true false
|
|
|
22c937 |
syn keyword cppConstant __cplusplus
|
|
|
22c937 |
" C++ 11 extensions
|
|
|
22c937 |
if !exists("cpp_no_cpp11")
|
|
|
22c937 |
syn keyword cppType override final
|
|
|
22c937 |
syn keyword cppExceptions noexcept
|
|
|
22c937 |
syn keyword cppStorageClass constexpr decltype thread_local
|
|
|
22c937 |
syn keyword cppConstant nullptr
|
|
|
22c937 |
syn keyword cppConstant ATOMIC_FLAG_INIT ATOMIC_VAR_INIT
|
|
|
22c937 |
syn keyword cppConstant ATOMIC_BOOL_LOCK_FREE ATOMIC_CHAR_LOCK_FREE
|
|
|
22c937 |
syn keyword cppConstant ATOMIC_CHAR16_T_LOCK_FREE ATOMIC_CHAR32_T_LOCK_FREE
|
|
|
22c937 |
syn keyword cppConstant ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE
|
|
|
22c937 |
syn keyword cppConstant ATOMIC_INT_LOCK_FREE ATOMIC_LONG_LOCK_FREE
|
|
|
22c937 |
syn keyword cppConstant ATOMIC_LLONG_LOCK_FREE ATOMIC_POINTER_LOCK_FREE
|
|
|
22c937 |
syn region cppRawString matchgroup=cppRawDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
|
|
|
22c937 |
endif
|
|
|
22c937 |
" The minimum and maximum operators in GNU C++
|
|
|
22c937 |
syn match cppMinMax "[<>]?"
|
|
|
22c937 |
" Default highlighting
|
|
|
22c937 |
if version >= 508 || !exists("did_cpp_syntax_inits")
|
|
|
22c937 |
if version < 508
|
|
|
22c937 |
let did_cpp_syntax_inits = 1
|
|
|
22c937 |
command -nargs=+ HiLink hi link <args>
|
|
|
22c937 |
else
|
|
|
22c937 |
command -nargs=+ HiLink hi def link <args>
|
|
|
22c937 |
endif
|
|
|
22c937 |
HiLink cppAccess cppStatement
|
|
|
22c937 |
HiLink cppCast cppStatement
|
|
|
22c937 |
HiLink cppExceptions Exception
|
|
|
22c937 |
HiLink cppOperator Operator
|
|
|
22c937 |
HiLink cppStatement Statement
|
|
|
22c937 |
HiLink cppType Type
|
|
|
22c937 |
HiLink cppStorageClass StorageClass
|
|
|
22c937 |
HiLink cppStructure Structure
|
|
|
22c937 |
HiLink cppBoolean Boolean
|
|
|
22c937 |
HiLink cppConstant Constant
|
|
|
22c937 |
HiLink cppRawDelimiter Delimiter
|
|
|
22c937 |
HiLink cppRawString String
|
|
|
22c937 |
delcommand HiLink
|
|
|
22c937 |
endif
|
|
|
22c937 |
let b:current_syntax = "cpp"
|
|
|
22c937 |
" vim: ts=8
|