sponsor Vim development Vim logo Vim Book Ad

cpp.vim : Extends C++ syntax highlighting to STL classes and method names

 script karma  Rating 209/90, Downloaded by 11894    Comments, bugs, improvements  Vim wiki

created by
Nathan Skvirsky
script type
My cpp.vim is intended to replace the cpp.vim that comes with the Vim package (the author of the original is Ken Shan <ccshan@post.harvard.edu>).  It extends the original cpp.vim's C++ syntax highlighting to SGI STL classes and method names (including, e.g., hash_map and hash_set, which do not appear in the official STL).  The color of STL identifiers is distinct from all other colors used by the cpp.vim syntax scheme.

As C++ evolves, future versions of this syntax file will reflect any official additions to the standard library, i.e. Boost.  (May happen earlier, depending on user requests.)

The STL highlighting scheme is applied to the following words:

abort abs accumulate acos adjacent_difference adjacent_find any append asctime asin assert assign at atan atan2 atexit atof atoi atol auto_ptr back back_inserter bad bad_alloc bad_cast bad_exception bad_typeid badbit begin binary_compose binary_negate binary_search binder1st binder2nd bitset bsearch c_str calloc capacity ceil cerr cin clear clearerr clock clog close compare const_iterator construct copy copy_backward copy_n cos cosh count count_if cout ctime data deque destroy difftime div domain_error empty end endl eof eofbit equal equal_range erase exception exit exp fabs fail failbit failure fclose feof ferror fflush fgetc fgetpos fgets fill fill_n find find_end find_first_not_of find_first_of find_if find_last_not_of find_last_of flags flip floor flush fmod fopen for_each fprintf fputc fputs fread free freopen frexp front fscanf fseek fsetpos fstream ftell fwrite gcount generate generate_n get_temporary_buffer getc getchar getenv getline gets gmtime good goodbit hash_map hash_multimap hash_multiset hash_set i2s ifstream ignore includes inner_product inplace_merge insert invalid_argument ios ios_base iostate iota is_heap is_open is_sorted isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace istream istream_iterator isupper isxdigit iter_swap iterator key_comp ldiv length length_error lexicographical_compare lexicographical_compare_3way list localtime log log10 logic_error longjmp lower_bound make_heap malloc map max max_element max_size mem_fun mem_fun1 mem_fun1_ref mem_fun_ref memchr memcpy memmove memset merge min min_element mismatch mktime modf multimap multiset next_permutation npos nth_element ofstream open ostream ostream_iterator out_of_range overflow_error pair partial_sort partial_sort_copy partial_sum partition peek perror pointer_to_binary_function pointer_to_unary_function pop pop_back pop_front pop_heap pow power precision prev_permutation printf ptr_fun push push_back push_front push_heap put putback putc putchar puts qsort raise rand random_sample random_sample_n random_shuffle range_error rbegin rdbuf rdstate read realloc remove remove_copy remove_copy_if remove_if rename rend replace replace_copy replace_copy_if replace_if reserve reset resize return_temporary_buffer reverse reverse_copy rewind rfind rotate rotate_copy runtime_error scanf search search_n seekg seekp set set_difference set_intersection set_symmetric_difference set_union setbuf setf setjmp setlocale setvbuf signal sin sinh size size_t sort sort_heap splice sprintf sqrt srand sscanf stable_partition stable_sort std str strcat strchr strcmp strcoll strcpy strcspn strerror strftime string strlen strncat strncmp strncpy strpbrk strrchr strspn strstr strtod strtok strtol strtoul strxfrm substr swap swap_ranges sync_with_stdio system tan tanh tellg tellp temporary_buffer test time time_t tmpfile tmpnam to_string to_ulong tolower top toupper transform unary_compose unary_negate underflow_error unget ungetc uninitialized_copy uninitialized_copy_n uninitialized_fill uninitialized_fill_n unique unique_copy unsetf upper_bound va_arg value_comp vector vfprintf vprintf vsprintf width write
install details
Make a backup copy of syntax/vim.cpp and overwrite syntax/vim.cpp with this file.

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
cpp.vim 1.12 2006-10-22 5.7 Nathan Skvirsky Added more STL reserved words
cpp.vim 1.1 2006-08-23 5.7 Nathan Skvirsky Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo