Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Additional Vim syntax highlighting for C++ (including C++11/14)
Branch: master

Merge pull request #14 from freeboson/master

readme meant to have absolute path
latest commit 6cdb94e439
@octol authored
Failed to load latest commit information.
after/syntax adding missing std::bit_xor readme meant to have absolute path

vim.cpp - additional vim c++ syntax highlighting

This file contains additional syntax highlighting that I use for 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.

Development is done at:


Optional features

Highlighting of class scope if disabled by default. To enable set

let g:cpp_class_scope_highlight = 1

Highlighting of template functions is enabled by setting

let g:cpp_experimental_template_highlight = 1

Note: C++ template syntax is notoriously difficult to parse, so don't expect this feature to be perfect.

Installation instructions

Follow one of the sets of directions below and reload vim afterwards.


If you have vundle installed, add

Plugin 'octol/vim-cpp-enhanced-highlight'

to .vimrc and run :PluginInstall from vim.

Git submodule + Pathogen

If you have pathogen installed, and you prefer to use git submodules, the following bash commands will help you do so.

cd ~/.vim
git submodule add bundle/syntax/

Manual installation

If you don't have either Vundle or Pathogen installed, copy the cpp.vim file (optionally also c.vim) to .vim/after/syntax.

git clone /tmp
mkdir -p ~/.vim/after/syntax/
mv /tmp/vim-cpp-enhanced-highlight/after/syntax/cpp.vim ~/.vim/after/syntax/cpp.vim
rm -rf /tmp/vim-cpp-enhanced-highlight

Background information

Jon Haggblad

Last update: 21 September 2014

Something went wrong with that request. Please try again.