Possible Duplicate:
Is there a C++11 syntax file for vim?
How can i update my VI
settings for it to recognize (and highlight appropriately) new keywords that came about with the new standard.
For example:
Keywords (also known as reserved words) have special meaning to the C++ compiler and are always written or typed in short(lower) cases. Keywords are words that the language uses for a special purpose, such as void, int, public, etc. It can't be used for a variable name or function name.
Identifiers are the unique names given to variables, classes, functions, or other entities by the programmer. For example, int money; double accountBalance; Here, money and accountBalance are identifiers.
The using keyword is used to: Bring a specific member from the namespace into the current scope. Bring all members from the namespace into the current scope. Bring a base class method or variable into the current class's scope.
You cannot use keywords as identifiers; they are reserved for special use.
Someone already wrote some syntax files for C++11: http://www.vim.org/scripts/script.php?script_id=3797. It even makes initializer lists and lambdas work fine without vim thinking the curlies are errors.
I remember I had to manually add some missing keywords to it, but that's not terribly complicated (just grep the file for the other keywords and add new ones). My current setup is up on GitHub. If you are using vundle you can install it with Bundle 'rmartinho/vim-cpp11'
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With