Skip to content

Commit

Permalink
Major update
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerun committed Jun 8, 2014
1 parent e961fa8 commit 45273d4
Show file tree
Hide file tree
Showing 24 changed files with 756 additions and 425 deletions.
100 changes: 76 additions & 24 deletions after/syntax/cpp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
" Language: C++ Additions
" Maintainer: Jon Haggblad <[email protected]>
" URL: http://www.haeggblad.com
" Last Change: 26 Jan 2014
" Version: 0.2
" Last Change: 21 Apr 2014
" Version: 0.3
" Changelog:
" 0.1 - initial version.
" 0.2 - C++14
" 0.3 - Incorporate lastest changes from Mizuchi/STL-Syntax
"
" Additional Vim syntax highlighting for C++ (including C++11)
"
" This file contains additional syntax highlighting that I use for my C++11
" This file contains additional syntax highlighting that I use for my C++11/14
" development in Vim. Compared to the standard syntax highlighting for C++ it
" adds highlighting of (user defined) functions and the containers and types
" in the standard library / boost.
Expand Down Expand Up @@ -54,6 +55,10 @@ hi def link cCustomFunc Function
" http://www.vim.org/scripts/script.php?script_id=1640
" -----------------------------------------------------------------------------
syntax keyword cppSTLconstant badbit
syntax keyword cppSTLconstant cerr
syntax keyword cppSTLconstant cin
syntax keyword cppSTLconstant clog
syntax keyword cppSTLconstant cout
syntax keyword cppSTLconstant digits
syntax keyword cppSTLconstant digits10
syntax keyword cppSTLconstant eofbit
Expand Down Expand Up @@ -82,6 +87,10 @@ syntax keyword cppSTLconstant radix
syntax keyword cppSTLconstant round_style
syntax keyword cppSTLconstant tinyness_before
syntax keyword cppSTLconstant traps
syntax keyword cppSTLconstant wcerr
syntax keyword cppSTLconstant wcin
syntax keyword cppSTLconstant wclog
syntax keyword cppSTLconstant wcout
syntax keyword cppSTLexception bad_alloc
syntax keyword cppSTLexception bad_array_new_length
syntax keyword cppSTLexception bad_exception
Expand Down Expand Up @@ -157,12 +166,9 @@ syntax keyword cppSTLfunction bsearch
syntax keyword cppSTLfunction calloc
syntax keyword cppSTLfunction capacity
syntax keyword cppSTLfunction ceil
syntax keyword cppSTLfunction cerr
syntax keyword cppSTLfunction cin
syntax keyword cppSTLfunction clear
syntax keyword cppSTLfunction clearerr
syntax keyword cppSTLfunction clock
syntax keyword cppSTLfunction clog
syntax keyword cppSTLfunction close
syntax keyword cppSTLfunction compare
syntax keyword cppSTLfunction conj
Expand All @@ -173,7 +179,6 @@ syntax keyword cppSTLfunction cos
syntax keyword cppSTLfunction cosh
syntax keyword cppSTLfunction count
syntax keyword cppSTLfunction count_if
syntax keyword cppSTLfunction cout
syntax keyword cppSTLfunction c_str
syntax keyword cppSTLfunction ctime
syntax keyword cppSTLfunction data
Expand Down Expand Up @@ -314,7 +319,7 @@ syntax keyword cppSTLfunction norm
syntax keyword cppSTLfunction not1
syntax keyword cppSTLfunction not2
syntax keyword cppSTLfunction nth_element
syntax keyword cppSTLfunction numeric_limits
syntax keyword cppSTLtype numeric_limits
syntax keyword cppSTLfunction open
syntax keyword cppSTLfunction partial_sort
syntax keyword cppSTLfunction partial_sort_copy
Expand Down Expand Up @@ -426,9 +431,9 @@ 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 strtold
syntax keyword cppSTLfunction strtoll
syntax keyword cppSTLfunction strtoul
syntax keyword cppSTLfunction strxfrm
Expand Down Expand Up @@ -466,7 +471,6 @@ syntax keyword cppSTLfunction unique_copy
syntax keyword cppSTLfunction unsetf
syntax keyword cppSTLfunction upper_bound
syntax keyword cppSTLfunction va_arg
syntax keyword cppSTLfunction va_arg
syntax keyword cppSTLfunction va_copy
syntax keyword cppSTLfunction va_end
syntax keyword cppSTLfunction value_comp
Expand Down Expand Up @@ -543,12 +547,18 @@ syntax keyword cppSTLnamespace rel_ops
syntax keyword cppSTLnamespace std
syntax keyword cppSTLtype allocator
syntax keyword cppSTLtype auto_ptr
syntax keyword cppSTLtype basic_filebuf
syntax keyword cppSTLtype basic_fstream
syntax keyword cppSTLtype basic_ifstream
syntax keyword cppSTLtype basic_iostream
syntax keyword cppSTLtype basic_istream
syntax keyword cppSTLtype basic_istringstream
syntax keyword cppSTLtype basic_ofstream
syntax keyword cppSTLtype basic_ostream
syntax keyword cppSTLtype basic_ostringstream
syntax keyword cppSTLtype basic_streambuf
syntax keyword cppSTLtype basic_string
syntax keyword cppSTLtype basic_stringbuf
syntax keyword cppSTLtype basic_stringstream
syntax keyword cppSTLtype binary_compose
syntax keyword cppSTLtype binder1st
Expand Down Expand Up @@ -577,7 +587,11 @@ syntax keyword cppSTLtype ifstream
syntax keyword cppSTLtype imaxdiv_t
syntax keyword cppSTLtype indirect_array
syntax keyword cppSTLtype int_type
syntax keyword cppSTLtype ios_base
syntax keyword cppSTLtype iostream
syntax keyword cppSTLtype istream
syntax keyword cppSTLtype istringstream
syntax keyword cppSTLtype istrstream
syntax keyword cppSTLtype iterator_traits
syntax keyword cppSTLtype key_compare
syntax keyword cppSTLtype key_type
Expand All @@ -598,6 +612,7 @@ syntax keyword cppSTLtype off_type
syntax keyword cppSTLtype ofstream
syntax keyword cppSTLtype ostream
syntax keyword cppSTLtype ostringstream
syntax keyword cppSTLtype ostrstream
syntax keyword cppSTLtype pair
syntax keyword cppSTLtype pointer
syntax keyword cppSTLtype pointer_to_binary_function
Expand All @@ -614,9 +629,12 @@ syntax keyword cppSTLtype size_type
syntax keyword cppSTLtype slice_array
syntax keyword cppSTLtype stack
syntax keyword cppSTLtype stream
syntax keyword cppSTLtype streambuf
syntax keyword cppSTLtype string
syntax keyword cppSTLtype stringbuf
syntax keyword cppSTLtype stringstream
syntax keyword cppSTLtype strstream
syntax keyword cppSTLtype strstreambuf
syntax keyword cppSTLtype temporary_buffer
syntax keyword cppSTLtype test_type
syntax keyword cppSTLtype time_t
Expand All @@ -631,11 +649,16 @@ syntax keyword cppSTLtype valarray
syntax keyword cppSTLtype value_compare
syntax keyword cppSTLtype value_type
syntax keyword cppSTLtype vector
syntax keyword cppSTLtype wfilebuf
syntax keyword cppSTLtype wfstream
syntax keyword cppSTLtype wifstream
syntax keyword cppSTLtype wiostream
syntax keyword cppSTLtype wistream
syntax keyword cppSTLtype wistringstream
syntax keyword cppSTLtype wofstream
syntax keyword cppSTLtype wostream
syntax keyword cppSTLtype wostringstream
syntax keyword cppSTLtype wstreambuf
syntax keyword cppSTLtype wstring
syntax keyword cppSTLtype wstringbuf
syntax keyword cppSTLtype wstringstream
Expand Down Expand Up @@ -810,6 +833,10 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLtype integral_constant
syntax keyword cppSTLtype true_type
syntax keyword cppSTLtype false_type
syntax keyword cppSTLfunction declval

syntax keyword cppSTLconstant piecewise_construct
syntax keyword cppSTLtype piecewise_construct_t

" memory
syntax keyword cppSTLtype unique_ptr
Expand All @@ -834,6 +861,12 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLtype pointer_traits
syntax keyword cppSTLfunction addressof
syntax keyword cppSTLfunction align
syntax keyword cppSTLfunction make_shared
syntax keyword cppSTLfunction allocate_shared
syntax keyword cppSTLcast static_pointer_cast
syntax keyword cppSTLcast dynamic_pointer_cast
syntax keyword cppSTLcast const_pointer_cast
syntax keyword cppSTLfunction get_deleter

" function object
syntax keyword cppSTLfunction bind
Expand All @@ -859,6 +892,7 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLfunction quick_exit
syntax keyword cppSTLfunction _Exit
syntax keyword cppSTLfunction at_quick_exit
syntax keyword cppSTLfunction forward

" date and time
syntax keyword cppSTLnamespace chrono
Expand All @@ -867,6 +901,8 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLtype steady_clock
syntax keyword cppSTLtype high_resolution_clock
syntax keyword cppSTLtype time_point
syntax keyword cppSTLcast duration_cast
syntax keyword cppSTLcast time_point_cast

" tuple
syntax keyword cppSTLtype tuple
Expand Down Expand Up @@ -925,6 +961,7 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLfunction copy_if
syntax keyword cppSTLfunction copy_n
syntax keyword cppSTLfunction move
syntax keyword cppSTLfunction move_if_noexcept
syntax keyword cppSTLfunction move_backward
syntax keyword cppSTLfunction shuffle
syntax keyword cppSTLfunction is_partitioned
Expand Down Expand Up @@ -1148,6 +1185,7 @@ if !exists("cpp_no_cpp11")

" thread
syntax keyword cppSTLtype thread
syntax keyword cppSTLnamespace this_thread
syntax keyword cppSTLfunction yield
syntax keyword cppSTLfunction get_id
syntax keyword cppSTLfunction sleep_for
Expand Down Expand Up @@ -1249,24 +1287,38 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLfunction wcstoimax
syntax keyword cppSTLfunction wcstoumax

syntax keyword cppSTLtype nanoseconds
syntax keyword cppSTLtype microseconds
syntax keyword cppSTLtype milliseconds
syntax keyword cppSTLtype seconds
syntax keyword cppSTLtype minutes
syntax keyword cppSTLtype hours

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

"memory
syntax keyword cppSTLfunction make_unique
endif " C++14

if !exists("cpp_no_boost")
"optional is not a part of C++14 anymore
syntax keyword cppSTLtype optional
"syntax keyword cppSTLfunction value
syntax keyword cppSTLfunction value_or
syntax keyword cppSTLfunction make_optional

syntax keyword cppSTLnamespace boost
syntax keyword cppSTLcast lexical_cast
endif " Boost

" Default highlighting
if version >= 508 || !exists("did_cpp_syntax_inits")
if version < 508
Expand All @@ -1276,15 +1328,15 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
command -nargs=+ HiLink hi def link <args>
endif
HiLink cppSTLfunction Function
HiLink cppSTLfunctional Type
HiLink cppSTLfunctional Typedef
HiLink cppSTLconstant Constant
HiLink cppSTLnamespace Constant
HiLink cppSTLtype Type
HiLink cppSTLexception Type
HiLink cppSTLiterator Type
HiLink cppSTLiterator_tag Type
HiLink cppSTLenum Type
HiLink cppSTLtype Typedef
HiLink cppSTLexception Exception
HiLink cppSTLiterator Typedef
HiLink cppSTLiterator_tag Typedef
HiLink cppSTLenum Typedef
HiLink cppSTLios Function
HiLink cppSTLcast Statement " be consistent with official syntax
delcommand HiLink
endif

4 changes: 2 additions & 2 deletions after/syntax/tex.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ syn region texRefZone matchgroup=texStatement start="\\\(label\|\)c\(page\|\)re

" adds support for listings package
syn region texZone start="\\begin{lstlisting}" end="\\end{lstlisting}\|%stopzone\>"
syn region texZone start="\\lstinputlisting" end="{\s*[a-zA-Z/.0-9_^]\+\s*}"
syn match texInputFile "\\lstinline\s*\(\[.*\]\)\={.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt
syn match texInputFile "\\lstinputlisting\s*\(\[.*\]\)\={.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt
syn match texZone "\\lstinline\s*\(\[.*\]\)\={.\{-}}"
2 changes: 1 addition & 1 deletion autoload/go/complete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function! go#complete#Package(ArgLead, CmdLine, CursorPos)
if executable('go')
let goroot = substitute(system('go env GOROOT'), '\n', '', 'g')
if v:shell_error
echomsg '\'go env GOROOT\' failed'
echomsg '''go env GOROOT'' failed'
endif
else
let goroot = $GOROOT
Expand Down
34 changes: 18 additions & 16 deletions autoload/htmlcomplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
" Last Change: 2010 Sep 25

if !exists('g:aria_attributes_complete')
let g:aria_attributes_complete = 1
let g:aria_attributes_complete = 1
endif

let b:html_omni_flavor = 'html5'

function! htmlcomplete#CompleteTags(findstart, base)
if a:findstart
" locate the start of the word
Expand Down Expand Up @@ -167,11 +169,11 @@ function! htmlcomplete#CompleteTags(findstart, base)
"runtime! autoload/xml/xhtml10s.vim
call htmlcomplete#LoadData()
endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
call htmlcomplete#LoadAria()
endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
call htmlcomplete#LoadAria()
endif

let entities = b:html_omni['vimxmlentities']
let entities = b:html_omni['vimxmlentities']

if len(a:base) == 1
for m in entities
Expand Down Expand Up @@ -469,9 +471,9 @@ function! htmlcomplete#CompleteTags(findstart, base)
"runtime! autoload/xml/xhtml10s.vim
call htmlcomplete#LoadData()
endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
call htmlcomplete#LoadAria()
endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
call htmlcomplete#LoadAria()
endif
" }}}
if attrname == 'href'
" Now we are looking for local anchors defined by name or id
Expand Down Expand Up @@ -551,9 +553,9 @@ function! htmlcomplete#CompleteTags(findstart, base)
if !exists("b:html_omni")
call htmlcomplete#LoadData()
endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
call htmlcomplete#LoadAria()
endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
call htmlcomplete#LoadAria()
endif
" }}}

if has_key(b:html_omni, tag)
Expand Down Expand Up @@ -658,9 +660,9 @@ function! htmlcomplete#CompleteTags(findstart, base)
"runtime! autoload/xml/xhtml10s.vim
call htmlcomplete#LoadData()
endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
call htmlcomplete#LoadAria()
endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
call htmlcomplete#LoadAria()
endif
" }}}
" Tag completion {{{
" Deal with tag completion.
Expand Down Expand Up @@ -763,9 +765,9 @@ endfunction
function! htmlcomplete#LoadData() " {{{
if !exists("b:html_omni_flavor")
if &filetype == 'html'
let b:html_omni_flavor = 'html401t'
let b:html_omni_flavor = 'html5'
else
let b:html_omni_flavor = 'xhtml10s'
let b:html_omni_flavor = 'html5'
endif
endif
" With that if we still have bloated memory but create new buffer
Expand Down
2 changes: 1 addition & 1 deletion autoload/xml/html5.vim
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ let abutton_dec = 'details\\|embed\\|iframe\\|keygen\\|label\\|menu\\|select\\|t

let g:xmldata_html5 = {
\ 'vimxmlentities': ['AElig', 'Aacute', 'Acirc', 'Agrave', 'Alpha', 'Aring', 'Atilde', 'Auml', 'Beta', 'Ccedil', 'Chi', 'Dagger', 'Delta', 'ETH', 'Eacute', 'Ecirc', 'Egrave', 'Epsilon', 'Eta', 'Euml', 'Gamma', 'Iacute', 'Icirc', 'Igrave', 'Iota', 'Iuml', 'Kappa', 'Lambda', 'Mu', 'Ntilde', 'Nu', 'OElig', 'Oacute', 'Ocirc', 'Ograve', 'Omega', 'Omicron', 'Oslash', 'Otilde', 'Ouml', 'Phi', 'Pi', 'Prime', 'Psi', 'Rho', 'Scaron', 'Sigma', 'THORN', 'Tau', 'Theta', 'Uacute', 'Ucirc', 'Ugrave', 'Upsilon', 'Uuml', 'Xi', 'Yacute', 'Yuml', 'Zeta', 'aacute', 'acirc', 'acute', 'aelig', 'agrave', 'alefsym', 'alpha', 'amp', 'and', 'ang', 'apos', 'aring', 'asymp', 'atilde', 'auml', 'bdquo', 'beta', 'brvbar', 'bull', 'cap', 'ccedil', 'cedil', 'cent', 'chi', 'circ', 'clubs', 'cong', 'copy', 'crarr', 'cup', 'curren', 'dArr', 'dagger', 'darr', 'deg', 'delta', 'diams', 'divide', 'eacute', 'ecirc', 'egrave', 'empty', 'emsp', 'ensp', 'epsilon', 'equiv', 'eta', 'eth', 'euml', 'euro', 'exist', 'fnof', 'forall', 'frac12', 'frac14', 'frac34', 'frasl', 'gamma', 'ge', 'gt', 'hArr', 'harr', 'hearts', 'hellip', 'iacute', 'icirc', 'iexcl', 'igrave', 'image', 'infin', 'int', 'iota', 'iquest', 'isin', 'iuml', 'kappa', 'lArr', 'lambda', 'lang', 'laquo', 'larr', 'lceil', 'ldquo', 'le', 'lfloor', 'lowast', 'loz', 'lrm', 'lsaquo', 'lsquo', 'lt', 'macr', 'mdash', 'micro', 'middot', 'minus', 'mu', 'nabla', 'nbsp', 'ndash', 'ne', 'ni', 'not', 'notin', 'nsub', 'ntilde', 'nu', 'oacute', 'ocirc', 'oelig', 'ograve', 'oline', 'omega', 'omicron', 'oplus', 'or', 'ordf', 'ordm', 'oslash', 'otilde', 'otimes', 'ouml', 'para', 'part', 'permil', 'perp', 'phi', 'pi', 'piv', 'plusmn', 'pound', 'prime', 'prod', 'prop', 'psi', 'quot', 'rArr', 'radic', 'rang', 'raquo', 'rarr', 'rceil', 'rdquo', 'real', 'reg', 'rfloor', 'rho', 'rlm', 'rsaquo', 'rsquo', 'sbquo', 'scaron', 'sdot', 'sect', 'shy', 'sigma', 'sigmaf', 'sim', 'spades', 'sub', 'sube', 'sum', 'sup', 'sup1', 'sup2', 'sup3', 'supe', 'szlig', 'tau', 'there4', 'theta', 'thetasym', 'thinsp', 'thorn', 'tilde', 'times', 'trade', 'uArr', 'uacute', 'uarr', 'ucirc', 'ugrave', 'uml', 'upsih', 'upsilon', 'uuml', 'weierp', 'xi', 'yacute', 'yen', 'yuml', 'zeta', 'zwj', 'zwnj'],
\ 'vimxmlroot': ['html'],
\ 'vimxmlroot': ['html', 'head', 'body'] + flow_elements,
\ 'a': [
\ filter(copy(flow_elements), "!(v:val =~ '". abutton_dec ."')"),
\ extend(copy(global_attributes), {'name': [], 'href': [], 'target': [], 'rel': linktypes, 'hreflang': lang_tag, 'media': [], 'type': []})
Expand Down
Loading

0 comments on commit 45273d4

Please sign in to comment.