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