-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
756 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.