/vim-native-syntax

Provides a small set of improved syntax highlights for C/C++

Primary LanguageVim Script

vim-native-syntax

This vim plugin provides additional C and C++ syntax files providing a minimal set of additional features beyond those provided by default. The majority of the contents of these files have been cherry picked from vim-cpp-enhanced-highlight to be focusing on language constructs and specifically not keywords found in the C & C++ standard libraries and Boost.

Installation

The preferred installation method is vundle but any method can be used.

Vundle

If you have vundle installed, add to your .vimrc and run :PluginInstall from vim.

Plugin 'kbenzie/vim-native-syntax'

Manual

If you do not use a plugin manager for vim, simply clone this repository if you do not already have a ~/.vim/after directory.

git clone https://github.com/octol/kbenzie/vim-native-syntax ~/.vim/after

Or simply copy the files c.vim and cpp.vim into ~/.vim/after/syntax.

Features

C

  • Highlight functions declarations and invocations, link to the Function highlight group.
  • Highlight NOTE in comment blocks, link to the Note highlight group (undefined).
  • Optionally highlight operators {}[]-+&|<>=!\/~.,;:*%&^?() with g:native_syntax#highlight_operators=1.

C++

  • Highlight template function declarations and invocations, link to the Function highlight group.
  • Highlight the identifiers before the scope operator, link to the Statement highlight group.
  • Highlight the auto keyword, link to the Type highlight group.

Attributions