This commit is contained in:
Adam Stankiewicz
2014-02-04 19:13:11 +01:00
parent 9a2b4f5cd8
commit fa57320919
6 changed files with 196 additions and 27 deletions

View File

@@ -2,10 +2,11 @@
" Language: C++ Additions
" Maintainer: Jon Haggblad <jon@haeggblad.com>
" URL: http://www.haeggblad.com
" Last Change: 17 May 2013
" Version: 0.1
" Last Change: 26 Jan 2014
" Version: 0.2
" Changelog:
" 0.1 - initial version.
" 0.2 - C++14
"
" Additional Vim syntax highlighting for C++ (including C++11)
"
@@ -139,6 +140,7 @@ syntax keyword cppSTLfunction atexit
syntax keyword cppSTLfunction atof
syntax keyword cppSTLfunction atoi
syntax keyword cppSTLfunction atol
syntax keyword cppSTLfunction atoll
syntax keyword cppSTLfunction back
syntax keyword cppSTLfunction back_inserter
syntax keyword cppSTLfunction bad
@@ -423,8 +425,11 @@ syntax keyword cppSTLfunction strrchr
syntax keyword cppSTLfunction strspn
syntax keyword cppSTLfunction strstr
syntax keyword cppSTLfunction strtod
syntax keyword cppSTLfunction strtof
syntax keyword cppSTLfunction strtold
syntax keyword cppSTLfunction strtok
syntax keyword cppSTLfunction strtol
syntax keyword cppSTLfunction strtoll
syntax keyword cppSTLfunction strtoul
syntax keyword cppSTLfunction strxfrm
syntax keyword cppSTLfunction substr
@@ -440,7 +445,6 @@ syntax keyword cppSTLfunction tellg
syntax keyword cppSTLfunction tellp
syntax keyword cppSTLfunction test
syntax keyword cppSTLfunction time
syntax keyword cppSTLfunction time_t
syntax keyword cppSTLfunction tmpfile
syntax keyword cppSTLfunction tmpnam
syntax keyword cppSTLfunction tolower
@@ -615,6 +619,7 @@ syntax keyword cppSTLtype stringbuf
syntax keyword cppSTLtype stringstream
syntax keyword cppSTLtype temporary_buffer
syntax keyword cppSTLtype test_type
syntax keyword cppSTLtype time_t
syntax keyword cppSTLtype tm
syntax keyword cppSTLtype traits_type
syntax keyword cppSTLtype type_info
@@ -635,6 +640,84 @@ syntax keyword cppSTLtype wstring
syntax keyword cppSTLtype wstringbuf
syntax keyword cppSTLtype wstringstream
syntax keyword cppSTLfunction mblen
syntax keyword cppSTLfunction mbtowc
syntax keyword cppSTLfunction wctomb
syntax keyword cppSTLfunction mbstowcs
syntax keyword cppSTLfunction wcstombs
syntax keyword cppSTLfunction mbsinit
syntax keyword cppSTLfunction btowc
syntax keyword cppSTLfunction wctob
syntax keyword cppSTLfunction mbrlen
syntax keyword cppSTLfunction mbrtowc
syntax keyword cppSTLfunction wcrtomb
syntax keyword cppSTLfunction mbsrtowcs
syntax keyword cppSTLfunction wcsrtombs
syntax keyword cppSTLtype mbstate_t
syntax keyword cppSTLconstant MB_LEN_MAX
syntax keyword cppSTLconstant MB_CUR_MAX
syntax keyword cppSTLconstant __STDC_UTF_16__
syntax keyword cppSTLconstant __STDC_UTF_32__
syntax keyword cppSTLfunction iswalnum
syntax keyword cppSTLfunction iswalpha
syntax keyword cppSTLfunction iswlower
syntax keyword cppSTLfunction iswupper
syntax keyword cppSTLfunction iswdigit
syntax keyword cppSTLfunction iswxdigit
syntax keyword cppSTLfunction iswcntrl
syntax keyword cppSTLfunction iswgraph
syntax keyword cppSTLfunction iswspace
syntax keyword cppSTLfunction iswprint
syntax keyword cppSTLfunction iswpunct
syntax keyword cppSTLfunction iswctype
syntax keyword cppSTLfunction wctype
syntax keyword cppSTLfunction towlower
syntax keyword cppSTLfunction towupper
syntax keyword cppSTLfunction towctrans
syntax keyword cppSTLfunction wctrans
syntax keyword cppSTLfunction wcstol
syntax keyword cppSTLfunction wcstoll
syntax keyword cppSTLfunction wcstoul
syntax keyword cppSTLfunction wcstoull
syntax keyword cppSTLfunction wcstof
syntax keyword cppSTLfunction wcstod
syntax keyword cppSTLfunction wcstold
syntax keyword cppSTLfunction wcscpy
syntax keyword cppSTLfunction wcsncpy
syntax keyword cppSTLfunction wcscat
syntax keyword cppSTLfunction wcsncat
syntax keyword cppSTLfunction wcsxfrm
syntax keyword cppSTLfunction wcslen
syntax keyword cppSTLfunction wcscmp
syntax keyword cppSTLfunction wcsncmp
syntax keyword cppSTLfunction wcscoll
syntax keyword cppSTLfunction wcschr
syntax keyword cppSTLfunction wcsrchr
syntax keyword cppSTLfunction wcsspn
syntax keyword cppSTLfunction wcscspn
syntax keyword cppSTLfunction wcspbrk
syntax keyword cppSTLfunction wcsstr
syntax keyword cppSTLfunction wcstok
syntax keyword cppSTLfunction wmemcpy
syntax keyword cppSTLfunction wmemmove
syntax keyword cppSTLfunction wmemcmp
syntax keyword cppSTLfunction wmemchr
syntax keyword cppSTLfunction wmemset
syntax keyword cppSTLtype wctrans_t
syntax keyword cppSTLtype wctype_t
syntax keyword cppSTLtype wint_t
syntax keyword cppSTLconstant WEOF
syntax keyword cppSTLconstant WCHAR_MIN
syntax keyword cppSTLconstant WCHAR_MAX
if !exists("cpp_no_cpp11")
syntax keyword cppSTLtype nullptr_t max_align_t
syntax keyword cppSTLtype type_index
@@ -968,6 +1051,7 @@ if !exists("cpp_no_cpp11")
" locale
syntax keyword cppSTLfunction isblank
syntax keyword cppSTLfunction iswblank
syntax keyword cppSTLtype wstring_convert
syntax keyword cppSTLtype wbuffer_convert
syntax keyword cppSTLtype codecvt_utf8
@@ -1016,13 +1100,51 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLfunction atomic_flag_clear
syntax keyword cppSTLfunction atomic_flag_clear_explicit
syntax keyword cppSTLtype atomic_bool
syntax keyword cppSTLtype atomic_char
syntax keyword cppSTLtype atomic_schar
syntax keyword cppSTLtype atomic_uchar
syntax keyword cppSTLtype atomic_short
syntax keyword cppSTLtype atomic_ushort
syntax keyword cppSTLtype atomic_int
syntax keyword cppSTLtype atomic_uint
syntax keyword cppSTLtype atomic_long
syntax keyword cppSTLtype atomic_ulong
syntax keyword cppSTLtype atomic_llong
syntax keyword cppSTLtype atomic_ullong
syntax keyword cppSTLtype atomic_char16_t
syntax keyword cppSTLtype atomic_char32_t
syntax keyword cppSTLtype atomic_wchar_t
syntax keyword cppSTLtype atomic_int_least8_t
syntax keyword cppSTLtype atomic_uint_least8_t
syntax keyword cppSTLtype atomic_int_least16_t
syntax keyword cppSTLtype atomic_uint_least16_t
syntax keyword cppSTLtype atomic_int_least32_t
syntax keyword cppSTLtype atomic_uint_least32_t
syntax keyword cppSTLtype atomic_int_least64_t
syntax keyword cppSTLtype atomic_uint_least64_t
syntax keyword cppSTLtype atomic_int_fast8_t
syntax keyword cppSTLtype atomic_uint_fast8_t
syntax keyword cppSTLtype atomic_int_fast16_t
syntax keyword cppSTLtype atomic_uint_fast16_t
syntax keyword cppSTLtype atomic_int_fast32_t
syntax keyword cppSTLtype atomic_uint_fast32_t
syntax keyword cppSTLtype atomic_int_fast64_t
syntax keyword cppSTLtype atomic_uint_fast64_t
syntax keyword cppSTLtype atomic_intptr_t
syntax keyword cppSTLtype atomic_uintptr_t
syntax keyword cppSTLtype atomic_size_t
syntax keyword cppSTLtype atomic_ptrdiff_t
syntax keyword cppSTLtype atomic_intmax_t
syntax keyword cppSTLtype atomic_uintmax_t
syntax keyword cppSTLtype memory_order
syntax keyword cppSTLfunction atomic_init
syntax keyword cppSTLfunction ATOMIC_VAR_INIT
syntax keyword cppSTLconstant ATOMIC_FLAG_INIT
syntax keyword cppSTLconstant kill_dependency
syntax keyword cppSTLconstant atomic_thread_fence
syntax keyword cppSTLconstant atomic_signal_fence
syntax keyword cppSTLfunction kill_dependency
syntax keyword cppSTLfunction atomic_thread_fence
syntax keyword cppSTLfunction atomic_signal_fence
" thread
syntax keyword cppSTLtype thread
@@ -1061,8 +1183,8 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLtype future
syntax keyword cppSTLtype shared_future
"syntax keyword cppSTLfunction async
"syntax keyword cppSTLenum launch
syntax keyword cppSTLfunction async
syntax keyword cppSTLenum launch
syntax keyword cppSTLenum future_status
syntax keyword cppSTLenum future_errc
@@ -1114,7 +1236,36 @@ if !exists("cpp_no_cpp11")
"limits
syntax keyword cppSTLfunction lowest
endif
"cuchar
syntax keyword cppSTLfunction mbrtoc16
syntax keyword cppSTLfunction c16rtomb
syntax keyword cppSTLfunction mbrtoc32
syntax keyword cppSTLfunction c32rtomb
"cinttypes
syntax keyword cppSTLfunction strtoimax
syntax keyword cppSTLfunction strtoumax
syntax keyword cppSTLfunction wcstoimax
syntax keyword cppSTLfunction wcstoumax
endif " C++11
if !exists("cpp_no_cpp14")
"optional
syntax keyword cppSTLtype optional
"syntax keyword cppSTLfunction value
syntax keyword cppSTLfunction value_or
syntax keyword cppSTLfunction make_optional
"dynarray
syntax keyword cppSTLtype dynarray
"thread
syntax keyword cppSTLtype shared_mutex
syntax keyword cppSTLtype shared_lock
endif " C++14
" Default highlighting
if version >= 508 || !exists("did_cpp_syntax_inits")

View File

@@ -106,13 +106,20 @@ function! LatexBox_GetMainTexFile()
return expand('%:p')
endif
" 4 borrow the Vim-Latex-Suite method of finding it
" 4. use 'main.tex' if it exists in the same directory (and is readable)
let s:main_dot_tex_file=expand('%:p:h') . '/main.tex'
if filereadable(s:main_dot_tex_file)
let b:main_tex_file=s:main_dot_tex_file
return b:main_tex_file
endif
" 5. borrow the Vim-Latex-Suite method of finding it
if Tex_GetMainFileName() != expand('%:p')
let b:main_tex_file = Tex_GetMainFileName()
return b:main_tex_file
endif
" 5. prompt for file with completion
" 6. prompt for file with completion
let b:main_tex_file = s:PromptForMainFile()
return b:main_tex_file
endfunction

View File

@@ -19,6 +19,9 @@ else
endif
unlet! b:did_indent
" Force HTML indent to not keep state.
let b:html_indent_usestate = 0
if &l:indentexpr == ''
if &l:cindent
let &l:indentexpr = 'cindent(v:lnum)'
@@ -53,7 +56,8 @@ function! GetErubyIndent(...)
else
exe "let ind = ".b:eruby_subtype_indentexpr
" Workaround for Andy Wokula's HTML indent
" Workaround for Andy Wokula's HTML indent. This should be removed after
" some time, since the newest version is fixed in a different way.
if b:eruby_subtype_indentexpr =~# '^HtmlIndent('
\ && exists('b:indent')
\ && type(b:indent) == type({})

File diff suppressed because one or more lines are too long

View File

@@ -261,7 +261,7 @@ if !exists("ruby_no_special_methods")
syn keyword rubyException raise fail catch throw
" false positive with 'include?'
syn match rubyInclude "\<include\>[?!]\@!"
syn keyword rubyInclude autoload extend load prepend require require_relative
syn keyword rubyInclude autoload extend load prepend refine require require_relative using
syn keyword rubyKeyword callcc caller lambda proc
endif
@@ -279,18 +279,18 @@ endif
" Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(alias\|and\|begin\|break\|case\|class\|def\|defined\|do\|else\)\>" transparent contains=NONE
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(elsif\|end\|ensure\|false\|for\|if\|in\|module\|next\|nil\)\>" transparent contains=NONE
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(not\|or\|redo\|rescue\|retry\|return\|self\|super\|then\|true\)\>" transparent contains=NONE
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(not\|or\|redo\|refine\|rescue\|retry\|return\|self\|super\|then\|true\)\>" transparent contains=NONE
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(undef\|unless\|until\|when\|while\|yield\|BEGIN\|END\|__FILE__\|__LINE__\)\>" transparent contains=NONE
syn match rubyKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)[?!]" transparent contains=NONE
syn match rubyKeywordAsMethod "\<\%(if\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE
syn match rubyKeywordAsMethod "\<\%(if\|module\|refine\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|attr\|attr_accessor\|attr_reader\)\>" transparent contains=NONE
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(attr_writer\|autoload\|callcc\|catch\|caller\)\>" transparent contains=NONE
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(eval\|class_eval\|instance_eval\|module_eval\|exit\)\>" transparent contains=NONE
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fail\|fork\|include\|lambda\)\>" transparent contains=NONE
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(load\|loop\|prepend\|private\|proc\|protected\)\>" transparent contains=NONE
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(public\|require\|require_relative\|raise\|throw\|trap\)\>" transparent contains=NONE
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(public\|require\|require_relative\|raise\|throw\|trap\|using\)\>" transparent contains=NONE
" __END__ Directive
syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold

View File

@@ -46,8 +46,6 @@ syn keyword rustType f64 i8 i16 i32 i64 str Self
" to make it easy to update.
" Core operators {{{3
syn keyword rustEnum Either
syn keyword rustEnumVariant Left Right
syn keyword rustTrait Sized
syn keyword rustTrait Freeze Send
syn keyword rustTrait Add Sub Mul Div Rem Neg Not
@@ -80,7 +78,6 @@ syn keyword rustTrait FromStr
syn keyword rustTrait FromIterator Extendable
syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator CloneableIterator
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
syn keyword rustTrait Times
syn keyword rustTrait Algebraic Trigonometric Exponential Hyperbolic
syn keyword rustTrait Bitwise Bounded Integer Fractional Real RealExt
@@ -94,16 +91,16 @@ syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
syn keyword rustTrait Str StrVector StrSlice OwnedStr
syn keyword rustTrait IterBytes
syn keyword rustTrait ToStr IntoStr
syn keyword rustTrait CopyableTuple ImmutableTuple
syn keyword rustTrait CloneableTuple ImmutableTuple
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
syn keyword rustTrait ImmutableTuple1 ImmutableTuple2 ImmutableTuple3 ImmutableTuple4
syn keyword rustTrait ImmutableTuple5 ImmutableTuple6 ImmutableTuple7 ImmutableTuple8
syn keyword rustTrait ImmutableTuple9 ImmutableTuple10 ImmutableTuple11 ImmutableTuple12
syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector ImmutableCopyableVector
syn keyword rustTrait OwnedVector OwnedCopyableVector OwnedEqVector MutableVector
syn keyword rustTrait Vector VectorVector CopyableVector ImmutableVector
syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector ImmutableCloneableVector
syn keyword rustTrait OwnedVector OwnedCloneableVector OwnedEqVector MutableVector
syn keyword rustTrait Vector VectorVector CloneableVector ImmutableVector
"syn keyword rustFunction stream
syn keyword rustTrait Port Chan GenericChan GenericSmartChan GenericPort Peekable
@@ -113,7 +110,6 @@ syn keyword rustSelf self
syn keyword rustBoolean true false
syn keyword rustConstant Some None " option
syn keyword rustConstant Left Right " either
syn keyword rustConstant Ok Err " result
syn keyword rustConstant Less Equal Greater " Ordering